I am adding a button dynamically in html like below: On click of that button I want to call a Javascript function:
var but = document.createElement(\"button\
but.onclick = function() { yourjavascriptfunction();};
or
but.onclick = function() { functionwithparam(param);};