Ad Code

✨🎆 Codex 1.0 PLACEMENT READY PROGRAM! 🎆✨

Get 75% Discount Early bird offer CLICK to JOIN CodeX 1.0 click

Jquery Selector

Jquery Selector

                                                 


It is used to select Html element from web pages

1) ID Selector

2)  Class Selector

3) Tag Selector


<button id="btn" >One</button>

<button class="abc">Two</button>

<button>Three</button>

$("#btn").click(function(){});

$(".abc").click(function(){});

$("button").click(function(){});



<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>

$(document).ready(function(){
   
   $("#btn").click(function(){alert("one")});
   $(".abc").click(function(){alert("two")});
   $("button").click(function(){alert("three")});

})


</script>
</head>
<body>

<button id="btn" >One</button>

<button class="abc">Two</button>

<button>Three</button>


</body>
</html>



Post a Comment

0 Comments