Prev Demo
jQuery
>
.Filter() - Filter Element From Group Of Similar Elements
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <style> .class{ color:green; } .class1{ color:orange; } .class2{ color:red; } </style> </head> <body> <p class="class">Delhi</p> <p class="class1">Hyderabad</p> <p class="class2">Mumbai</p> <script> $("p").filter(".class1").css("border", "1px dotted red"); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output