Edit The Code:
See Result »
Try it Yourself - ©
w3big.com
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>本教程(w3big.com)</title> <script src="http://cdn.static.w3big.com/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("p").eq(-2).css("background-color","yellow"); }); </script> </head> <body> <h1>欢迎来到我的主页</h1> <p>我的名字叫 Donald。</p> <p>Donald Duck。</p> <p>我住在 Duckburg (将被选中,因为它是倒数第二个元素)。</p> <p>我最好的朋友是 Mickey。</p> </body> </html>