ux click

 

Description

A wrapper for the listen function.

Parameters

string

The element ID to add the onclick event

function

The function to trigger on the event

Return


No return value

Example


<span id="click-example">Try to click me</span>
<script>ux.click("click-example",function(){alert("Not so strong! XD");});</script>

 

Preview:

In the preview of the example you can see the result of the string:

A click function is displayed: "Try to click me". When clicking the function, a message appears in a separate box which you can close with "OK".