Prev Demo
jQuery
>
.Find() - Find Descendant 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; border:1px red; } .class2{ color:red; } </style> </head> <body> <div> <p class="class">Delhi</p> <p class="class1">Hyderabad</p> <p class="class2">Mumbai</p> </div> <br /> <br /> <p>The style given to the HYDERABAD is 1px RED BORDER, but in script code it is changed 5px DASHED GREEN.</p> <script> $("div").find(".class1").css("border", "5px dashed green"); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output