mozilla
Your Search Results

    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: jswisher, Sheppy, madarche, Marsf, Marcoos, pippijn, BenoitL, Mgjbot, Dria, Pmash, M1k.
    Last updated by: Sheppy,