onclick
The onclick property returns the onClick event handler code on the current element.
Syntax
event handling code = element.onclick
Example
Perhaps the simplest example of using the onclick DOM property is to retrieve the existing onclick event handler code. The following function sets the event handler code, then gets it and displays it.
function pawnClick() { p = document.getElementById("mutable"); p.onclick = "alert('moot!');"; text = p.onclick; alert(text); }
Notes
The click event is raised when the user clicks on an element.
Specification
Netscape Communications http://developer.netscape.com |