Jquery Selector

0
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>



Tags

Post a Comment

0Comments

POST Answer of Questions and ASK to Doubt

Post a Comment (0)