I have the following string
str ='<div id="example">Text</div><div id="test">Test</div>';
how can I get the example and test content with jQuery.
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.
You need to convert the text to a jQuery object and then use standard traversing methods
demo at http://jsfiddle.net/gaby/FJSm6/
As you see i set the string as the html of another element, because otherwise the divs would be at the top level and you would not be able to traverse them with
.find()..