The ondblclick EventThe ondblclick event occurs when the user double-clicks an object. You can find the support for this event in Table 6.66. Table 6.66. The ondblclick Event
When a user double-clicks an element, an onclick event occurs after the first click, and then an ondblclick event after the second click.Virtually all visible objects in the Internet Explorer from version 4.0 on support ondblclick ,but support in the Netscape Navigator is much more limitedthe Netscape Navigator 4.0 supported this event for link objects only, for example. Here's an example that responds by displaying a message when you double-click a web page: (Listing 06-14.html on the web site)<HTML> <HEAD> <TITLE>Using the ondblclick Event</TITLE> <SCRIPT LANGUAGE="JavaScript"> <!-- function display() { document.form1.text1.value = "You double clicked this Web page!" } // --> </SCRIPT> </HEAD> <BODY ONDBLCLICK="display()" ID="body1"> <H1>Using the ondblclick Event</H1> <FORM NAME="form1"> <INPUT TYPE="TEXT" ID="text1" SIZE="60"></INPUT> </FORM> </BODY> </HTML> You can see the results in Figure 6.9. Figure 6.9. Using the ondblclick event.
|