I was working on a small project to create some buttons dynmicaly using javascript .
var oCel2 = newRow.insertCell(4);
var button = document.createElement(‘input’);
button.setAttribute(‘type’,'button’);
button.setAttribute(‘name’,'button1′)
button.setAttribute(‘id’,'button1′)
button.setAttribute(‘value’,'Delete’);
// button.onclick= ‘removeRow(this)’; // wrong way – adding text not a function
button.onclick= new Function(‘removeRow(this)’); // correct way – adding a function
oCel2.appendChild(button);
Hope it helps someone. Thanks