I’m creating dynamic checkbox and attaching onclick event with that. Below is the code:
var table = document.getElementById(tableID);
var rowCount = table.rows.length;
var row = table.insertRow(rowCount);
var cell1 = row.insertCell(0);
var checkbox = document.createElement("input");
checkbox.type = 'checkbox';
checkbox.onclick = testClick();
cell1.appendChild(checkbox);
function testClick() {
alert("Hello");
}
The above piece of code is working fine with IE9 but not with IE8. I’m using Jquery 1.7.1.
Any help will be greatly appreciated. Thanks..
If you are using jQuery, why not use it? That takes care of cross browser issues