我正在尝试删除杂散元素。有些没有class
orid
属性,他们专门有一个自定义元素也没有id
orclass
属性。但是,在某些情况下,自定义元素确实具有类名。
唯一应该保留的 P,只有文本或 Video 元素。
$("p:contains("$("getimage")")").remove();
有没有更好的方法来让它工作?
编辑
“getimage”是自定义标签。
<div class="ajaxPostText">
<p><getimage style="display:none;" height="360" width="640" src="http://localhost:8888/localTesting/wp-content/plugins/wp-o-matic/cache/687a91dca2_ku-xlarge.jpg" class="transform-ku-xlarge"></getimage></p>
<p>Movies are too long. Even film masterpieces can shave off a few minutes here and there so we can get off our butts, away from laptops, out of theaters, eyeballs off the TV a little bit earlier. So. How short can a movie be for you to get the gist of it? Can it be done in nine single frames?</p>
</div>