专注前端素材!
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="http://cdn.sucai8.cn/cdn/jquery/jquery-1.10.2.js"> </script> <script> $(document).ready(function(){ $("p").not(".url").css("background-color","yellow"); }); </script> </head> <body> <h1>欢迎访问我的主页</h1> <p>素材8网教程 (index 0).</p> <p class="url">http://www.runoob.com (index 1)。</p> <p>google (index 2).</p> <p class="url">http://www.google.com (index 3)。</p> </body> </html>
运行结果