0
하위 요소를 가져 오지 않고이 div의 텍스트를 쉽게 잡을 수 있습니까?JQuery 그래버 텍스트 하위 요소에서 하위 요소
<div id="someselector">
<strong>Title Text Unwanted</strong> This is the text I need
</div>
나는 강하게 부분 문자열을 할 수 있음을 알고 있습니다.
$("#someselector").clone().children().remove().end().text();
먼저 요소를 복제, 얻을 :
$('#someselector').html().not('strong').text()
$ ('# somselector') [0] .childNodes [0] .nodeValue' – Mouser