1$( "#target" ).click(function() {
2 alert( "Handler for .click() called." );
3});
1$( "#target" ).click(function() {
2 alert( "Handler for .click() called." );
3});
4
1//Click for event to trigger
2
3$( "#target" ).click(function() {
4 alert( "Handler for .click() called." );
5});
1<script>
2$(document).ready(function(){
3 $("#btn-txt").click(function(){
4 var ptext = $("#my-para").text();
5 alert(ptext);
6 });
7});
8</script>
9<button type="button" id="btn-txt">Get Text Content</button>
10<p id="my-para">This is a paragraph to Show jQuery text method.</p>
11