Compare Revisions

GlobalEventHandlers.onclick

Revision 49715:

Revision 49715 by BenoitL on

Revision 49716:

Revision 49716 by Racer on

Title:
element.onclick
element.onclick
Slug:
DOM/element.onclick
DOM/element.onclick
Tags:
DOM, Gecko, "Gecko DOM Reference"
DOM, Gecko, "Gecko DOM Reference"
Content:

Revision 49715
Revision 49716
n40var el = document.getElementById('foo');n40var p = document.getElementById('foo');
41el.onclick = showPopup;41p.onclick = showPopup;
nn47  alert("moot!")
tt52</pre>
53    <p>
54      Or you can use an anonymous function, like this:
55    </p>
56    <pre>
57p.onclick = function() { alert("moot!"); };

Back to History