oncommand

oncommand
Type: script code
This event handler is called when the command is activated. This occurs when a user selects a menu item or presses a keyboard shortcut attached to the command.

Example 1: in-line code

<button label="Click me" oncommand="alert('Hi')"/>

Example 2: function with source argument

<button label="Click me" oncommand="doSomeProcessing(event.target)"/>
And here is the definition of the function:
function doSomeProcessing(source) {
  alert("source: " + source);
  return true;
}

See also

command element

Document Tags and Contributors

Contributors to this page: Sheppy, Marcoos, pippijn, jswisher, Marsf, BenoitL, M1k., Mgjbot, Pmash, Dria, madarche
Last updated by: Sheppy,