0
나는 HTML의 키워드를 링크로 대체하는 함수를 작성한다. 문제는 키워드가 링크에있을 때 링크가 바뀌게된다는 것입니다. 나는 그것이 교체하기 전에 앵커 태그가 있는지 확인하기 위해 루프의 각 요소를 확인 할jquery and RegExp
<div id="content">
<h2>the word "example" replaced by the link</h2>
<p>this is an example</p>
<p>this is an example number 2</p>
<p><a href="http://www.wrong.com">this is an example</a></p>
</div>
jQuery의'.html' 메소드는 모르지만 정규 표현식으로 HTML을 구문 분석하려는 다른 시도처럼 보입니다. – Svante