当前位置: 代码迷 >> Web前端 >> jQuery抉择不包含某个ID的其他数据
  详细解决方案

jQuery抉择不包含某个ID的其他数据

热度:148   发布时间:2012-11-23 00:03:43.0
jQuery选择不包含某个ID的其他数据
$('li').not(':even').css('background-color', 'red');



$('li').not(document.getElementById('notli'))
  .css('background-color', 'red');


 $("div").not(".green, #blueone")
            .css("border-color", "red");


Example: Removes the element with the ID "selected" from the set of all paragraphs.

$("p").not( $("#selected")[0] )
Example: Removes the element with the ID "selected" from the set of all paragraphs.

$("p").not("#selected")
Example: Removes all elements that match "div p.selected" from the total set of all paragraphs.

$("p").not($("div p.selected"))


$("#reset").click(function() {
  $(':input','#fundingpossibility')
  .not(':button, :submit, :reset, :hidden, #test')
  .val('');
});
  相关解决方案