jafisher2000
Programmer
Could someone tell me how to write event handlers for Dhtml objects such as window.onunload using javascript but not enclosing the actio to be executed within a standalone script tag?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<a href="[URL unfurl="true"]http://www.tek-tips.com"[/URL] onclick="confirm('Do you really want to leave my site?')?return true; return false;)">
function addCommentBox(idStr){
var el = document.createElement( "div" );
var btn = document.createElement( "input" );
btn.setAttribute("type", "button");
btn.setAttribute("onclick", "doSomething(this, '" + idStr + "')");
btn.setAttribute("value", "Ok");
el.appendChild(btn);
document.body.appendChild(el);
}