Posted in jquery
6
5:33 am, July 3, 2019

jquery click function

Bind something to a click event on an element using jquery. Needs to be combined with a document ready.

HTML

<div id="target">i'm the target!</div>

Javascript

$(document).ready(function(){
$( "#target" ).click(function() {
  alert( "Handler for .click() called." );
});
});
i'm the target!

View Statistics
This Week
20
This Month
123
This Year
0

No Items Found.

Add Comment
Type in a Nick Name here
 
Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code snippits here, mostly for my reference. Also if i find a good site, i usually add it here.

Join me on Substack if you want me to send you a collection of the things i have done or found or read for the week. Or follow me on twitter if you prefer, i dont post much but i probably should!

❤👩‍💻🕹

Random Quote
You drown not by falling in the river, but by staying submerged.
Unknown