var del = document.createElement('input');
del.type = 'button';
del.name = 'delll';
del.value = 'del';
del.onClick = 'alert("hi javascript")';
Here I have dynamically created a input type BUTTON and now I want to call function on button click event. I am using onClick();
function for this. In the above code all is working fine but del.onclick
is not working as I want (for generating alert for demo)
I am not using any jquery code in this program so please don't use any jquery code.