The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Click to call – function Reply To: Click to call – function


If you’re using jQuery:

For example:

$('#my-element').on('click', myFunction);

If you want to use straight up JavaScript:

Plenty of examples there. For plain JS, your code might need to look different depending on what browsers you need to support.