hub.eb?material_id=58

HTML Event Handlers


Client-side events are driven by the browser in response to end-user interaction with the page. You can create HTML Event Handlers that bind to HTML events and run client-side JavaScript when they are triggered.

To create these handlers click on the HTML Tab in the Custom Event Handlers area of the HTML Element Properties dialog.

Then select an event from the Event dropdown and launch the code editor by clicking ... next to the code input.

Events include:

  • onblur.
  • onclick.
  • onchange.
  • ondblclick.
  • onfocus.
  • onkeydown.
  • onkeypress.
  • onkeyup.
  • onmousedown.
  • onmousemove.
  • onmouseout.
  • onmouseover.
  • onmouseup.
  • onresize.
  • onselect.

Steps


1

Create a Form and add a Text Control with the text: Double Click Me.

2

Open the HTML Element Properties and select the HTML tab within the Custom Event Handlers area.

Select the ondblclick event and add the following code:

this.style.color = "green";
3

Run the Form and double click on the text. You will notice that it turns green.

Part of tracks

Related