$("p").filter(function(index) { return $("ol", this).length == 0; });


$("ol", this)是在this中查找ol元素 $("ol", this).length==0就是查找this中不包含ol的this元素(这里的this是<p>) return $("ol", this).length == 0;是相对filter来说的,如果return $("ol", this).length == 0为true的话保留,return $("ol", this).length == 0是false的话元素被删除 这整句话的意思就是:查找<p>中不包含<ol>的<p>元素

相关文章:

  • 2022-12-23
  • 2021-10-22
  • 2021-06-23
  • 2021-08-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-01
  • 2022-01-11
  • 2021-12-17
  • 2022-12-23
  • 2021-06-21
  • 2021-09-29
相关资源
相似解决方案