Whenever I click the checkbox, an image should be displayed. Unfortunately, I encountered an error:
Uncaught TypeError: Cannot read property 'checked' of null
at (index):185
at dispatch (VM576 jquery.min.js:3)
at i (VM576 jquery.min.js:3)
Could you please guide me on how to resolve this issue? I have included my code below.
http://jsfiddle.net/xda0kL6w/1/
if (document.getElementById('checkIDGrid').checked) {
alert("I am checked for the grid");
var img = $('<img />', {
id: 'Myid',
src: 'https://thumbs.dreamstime.com/z/pixel-perfect-web-development-flat-icons-set-website-programming-process-webpage-coding-user-interface-creating-45297890.jpg',
alt: 'MyAlt'
});
img.appendTo($('<tr>'));
} else {
alert("I am not checked for the grid");
}