首页javascriptclassjQuery Selector - 如何选择具有类的元素,除了具有特定ID的元素

jQuery Selector - 如何选择具有类的元素,除了具有特定ID的元素

我们想知道如何选择具有类的元素,除了具有特定ID的元素。

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.6.3.js'></script>
<style type='text/css'>
div {
  border: 1px solid red;
}
</style>
<script type='text/javascript'>
$(window).load(function(){
    $('.ui-widget-content').not('#helpDialog').css('border','none');
});
</script>
</head>
<body>
  <div class="ui-widget-content">test1</div>
  <div class="ui-widget-content" id="helpDialog">test2</div>
</body>
</html>