I have made a fiddle: http://jsfiddle.net/hAzJq/
How can i select the text inside the div but not inside the span?
alert($("div").not('span').text());
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
.contentsfirst, which will extract both text nodes and HTML nodes, and apply a:notselector to filter out thespan:That said, an easier way might be to apply a different
spanwith a special class around just the content you do want, and select that.