나는 (태그 <p>
) 그들을 그것들을 비슷하게 비교해보고 그것들을 제거하고, 비슷하지 않은 다른 단어를 보여주고 싶다. 하지만이 코드가 제거 된 how are you?
beacuse가 비슷하다고 생각합니다 how
, 어떻게해야합니까?jQuery와 함께 문구 비교
예 : 케이스 출력http://jsfiddle.net/CCMKu/
<span style="display: none;">
<p>hello</p>
<p>hi</p>
<p>how</p>
<p>what</p>
</span>
<div class="remove">
<p>hello</p>
<p>how</p>
<p>how are you?</p>
<p>what</p>
<p>fine</p>
<p>hi</p>
</div>
$("span p").each(function() {
$(".remove p:contains(" + $(this).text() + ")").remove();
});
출력된다 fine
는 fine
$ how are you?
이어야한다.