Is there any alternative to doing the following line:
document.getElementById("btn").setAttribute("onclick", "save(" + id + ");");
This line basically changes the onclick() event of a button to something like: save(34); , save(35); etc. However it fails in IE 7 and 6 but works in IE 8 and Firefox.
I can use jquery for this as well.
If you can use jQuery, then: