hub.eb?material_id=60&track_id=309

jQuery Event Handlers


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

To use jQuery Event Handlers you will need to include a jQuery library in the Web Resources of your Page, Form or Theme. 

Usually when you include a jQuery library its functions are available with the alias $, however, if your library uses a different alias, you must specify it in the jQuery Event Handler configuration.

To create a jQuery Event Handler, select the jQuery Tab in the Custom Event Handlers area of the HTML Element Properties dialog.

Events include:

  • blur.
  • change.
  • click.
  • doubleclick.
  • error.
  • focus.
  • hover.
  • keydown.
  • keypress.
  • keyup.
  • mousedown.
  • mouseover.
  • mouseup.
  • ready.
  • resize.
  • scroll.
  • select.
  • submit.
  • unload.

You will need to specify a Locator (Id or class) in the HTML Element Properties window that will be used to bind the Event Handler to the Control.

Steps


1

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

2

Open the HTML Element Properties and assign the id: turnGreen.

Select the jQuery tab within the Custom Event Handlers area.

Select the click event and add the following code:

$(this).css("color", "green");
3

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

Current Module

Part of tracks

Related