日期:2014-05-16 浏览次数:20375 次
Quote: 引用: class $("ul").find("a[class!='test']") 不好意思 所有a标记要这样获得------解决方案--------------------$("ul[id='ulid'] a[className!='test']")------解决方案-------------------- <!DOCTYPE html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("a").not(".test").css("background-color","yellow"); }); </script> </head> <body> <ul id="ulid" > <a class="test" /> testtttttt</a> <a class="abc" />aaaa</a> <a class="cbd" />bbbb</a> </ul> </body> </html>
class
<!DOCTYPE html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("a").not(".test").css("background-color","yellow"); }); </script> </head> <body> <ul id="ulid" > <a class="test" /> testtttttt</a> <a class="abc" />aaaa</a> <a class="cbd" />bbbb</a> </ul> </body> </html>