<html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $(".qwe:not('a')").css("background-color", "DeepPink"); }); </script> </head> <body> <a class="qwe">link</a> <div class="qwe">div</div> <span class="qwe">span</span> <p class="qwe" >p</p> </body> </html>
var content=document.getElementsByClassName(clasS); for(var i=0;i<content.length;i++){ if(content[i].tagName !="a"){ content=content[i]; } }