TOC PREV NEXT INDEX

Put your logo here!


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

Not part of specification.


mozilla.org | mailto:oeschger | bug 93108
TOC PREV NEXT INDEX