[jQuery] get text of a element, but without children text
[jQuery] get text of a element, but without children text
<ul> <li> text1 <ul> <li>text2</li> </ul> </li> </ul> when i use $("ul li").text() i got a string containing both "text1" and "text2", how can i just get the string "text1". thanks in advance.