Demo of click event using JQuery



You can click on this text

HTML


<input type=button value='Click me' id='b1'> <p id='b2'>You can click on this text</p>
<div id='t1' style="position:absolute;"></div>

jquery


<script>
$(document).ready(function() {

$("#b1").click(function(){
$("#t1").html('You  clicked the button');
});

$("#b2").click(function(){
$("#t1").html('You clicked the Text');
});

})
</script>