Sublime Text
<!DOCTYPE html> <html> <head> <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.0.min.js"></script> <style type="text/css"> div{ border:1px solid black; padding:30px; } </style> </head> <body> <button type="button">Click here</button><br><br> <div style="position:relative"> <div style="position:relative"> <div style="position:static"> <p>- Lập Trình Web</p> </div> </div> </div> <script> $(document).ready(function(){ $("button").click(function(){ $("p").offsetParent().css("border","3px solid red"); }); }); </script> </body> </html>
<!DOCTYPE html> <html> <head> <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.0.min.js"></script> <style type="text/css"> div{ border:1px solid black; padding:30px; } </style> </head> <body> <button type="button">Click here</button><br><br> <div style="position:relative"> <div style="position:relative"> <div style="position:static"> <p>- Lập Trình Web</p> </div> </div> </div> <script> $(document).ready(function(){ $("button").click(function(){ $("p").offsetParent().css("border","3px solid red"); }); }); </script> </body> </html>