Prev Demo
jQuery
>
.Parent() - Find Parent Element
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> </head> <body> <div> <ul>APPLE</ul> <ul>BANANA</ul> <ul>CAR</ul> <ul>DOLL</ul> <ul>Eagle</ul> </div> <br/> <br/> <script> $("ul").parent().css("border", "2px dashed green "); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output