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." );
});
});

Demo

i'm the target!
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.

❤👩‍💻🕹