In HTML: <ELEMENT ondblclick="handler"> In JavaScript: object.ondblclick = handler; object.addEventListener("dblclick", handler, useCapture); 9 object.attachEvent("ondblclick", handler); You can find the related
In JavaScript, using the addEventListener() method: object.addEventListener("dblclick",myScript); Try it Yourself » Technical Details Bubbles:Yes Cancelable:Yes Event type:MouseEvent HTML tags:All HTML elements, EXCEPT: , , , , , , , , , , and . DOM Version:Level 2 Events ondblclickis ...
代码语言:javascript 代码运行次数: <meta http-equiv="Content-Type"content"text/html;charset=UTF-8"functionondblclick_f(){alert("这里是双击事件!");}functiononclick_f(){alert("这里是单事件!");}</script<
Output: Explanation: In this example, every time you double click thebuttonelement, one line of JavaScript code is executed which causes an alert box to be displayed with a message. Language(s): XHTML See Also:
JavaScript Tutorial HTML Tags a link The onDblClick event handler handles the event when the mouse cursor is double-clicked on the link. Using the onDblClick event handler of the Link object Click the link. www.java2s.com
event attributes of an HTML elementallow users to initiate some action (as if some script is being executed) against interaction (e.g. clicking by mouse, pressing a key etc). For all the examples, and syntax, we have used abbr element. ...
In JavaScript, using the addEventListener() method: object.addEventListener("dblclick",myScript); Try it Yourself » Technical Details Bubbles:Yes Cancelable:Yes Event type:MouseEvent HTML tags:All HTML elements, EXCEPT: , , , , , , , , , , and . DOM Version:Level 2 Events Browser Suppo...