ÍøÂçѧԺ

w3pop.com :: ÍøÂçѧԺ :: JavaScript :: JavaScript ondblclick ʼþ

»áÔ±µÇ½

ÕʺÅ

ÃÜÂë

»Ø´ð

¼ÇסÃÜÂë

Íü¼ÇÃÜÂë? ×¢²á

JavaScript ondblclick ʼþ


×÷Õß:w3pop.com ·­Òë/ÕûÀí:w3pop.com ·¢²¼:2007-04-28 ä¯ÀÀ:3983 :: ::

Definition and Usage
¶¨ÒåÓëÓ÷¨

The ondblclick event occurs when an object gets double-clicked.
µ±Ò»¸ö¶ÔÏñ±»Ë«»÷ʱ´¥·¢ondblclickʼþ

Syntax
Óï·¨

ondblclick="ËùÒªÖ´ÐеĴúÂë"

Parameter
²ÎÊý
Description
×¢ÊÍ
SomeJavaScriptCode
ËùÒªÖ´ÐеĴúÂë
Required. Specifies a JavaScript to be executed when the event occurs.
±ØÑ¡Ïî¡£µ±Ê¼þ´¥·¢Ê±ËùÒªÖ´ÐеĽű¾

Supported by the following HTML tags:
ËùÖ§³ÖµÄHTML±êÇ©£º

<a>, <address>, <area>, <b>, <bdo>, <big>, <blockquote>, <body>, <button>, <caption>, <cite>, <code>, <dd>, <dfn>, <div>, <dl>, <dt>, <em>, <fieldset>, <form>, <h1> to <h6>, <hr>, <i>, <img>, <input>, <kbd>, <label>, <legend>, <li>, <map>, <object>, <ol>, <p>, <pre>, <samp>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <table>, <tbody>, <td>, <textarea>, <tfoot>, <th>, <thead>, <tr>, <tt>, <ul>, <var>

Supported by the following JavaScript objects:
ËùÖ§³ÖµÄJavaScript¶ÔÏó£º

document, link


Example
ʵÀý

In this example the second field changes according to the first field when you double-click on the button:
ÔÚÏÂÃæµÄÀý×ÓÖУ¬µ±ÄãË«»÷°´Å¥Ê±µÚÒ»¸öÎı¾¿òÄÚµÄÎÄ×Ö½«±»¸´ÖƵ½µÚ¶þ¸öÎı¾¿ò£º

<html>
<body>
Îı¾Ò»£º<input type="text" id="field1" value="ÄãºÃ£¡">
<br />
Îı¾¶þ£º<input type="text" id="field2">
<br /><br />
Ë«»÷°´Å¥½«Îı¾¿òÒ»ÄÚµÄÎÄ×Ö¸´ÖƵ½Îı¾¿ò¶þ
<br />
<button ondblclick="document.getElementById('field2').value=
document.getElementById('field1').value">¸´ÖÆÎÄ×Ö</button>
</body>
</html>

The output of the code above will be:
Êä³ö½á¹ûΪ£º

Îı¾Ò»£º
Îı¾¶þ£º

Ë«»÷°´Å¥½«Îı¾¿òÒ»ÄÚµÄÎÄ×Ö¸´ÖƵ½Îı¾¿ò¶þ


Try-It-Yourself Demos
»¥¶¯ÑÝÁ·

ondblclick
How to use ondblclick.
ÈçºÎÓ¦ÓÃondblclick

ÆÀÂÛ (0) All