【发布时间】:2010-05-04 15:41:31
【问题描述】:
我正在尝试编写一个 CSS 选择器,它使用 hpricot 选择除脚本元素之外的所有内容,我可以轻松选择 select-me div 的所有内容,然后删除脚本元素,但我想知道它是否可以使用将排除脚本元素的选择器:
<div class='select-me'>
<p>This is some text</p>
<script>
javascript would be here
</script>
<p>This is some text</p>
</div>
所以最后我回来了:
<div class='select-me'>
<p>This is some text</p>
<p>This is some text</p>
</div>
干杯
【问题讨论】: