共用方式為


Command.onclick event

Raised when the user clicks the Command.

Syntax

function handler(eventInfo) { /* Your code */ }
 
// addEventListener syntax
command.addEventListener("click", handler);
command.removeEventListener("click", handler);
 
- or -

command.onclick = handler;

Event information

Synchronous No
Bubbles Yes
Cancelable Yes

 

Event handler parameters

  • eventInfo
    Type: Event**

    An object that contains information about the event.

Requirements

Minimum WinJS version

WinJS 4.0

Namespace

WinJS.UI

See also

Command