I have an element (for example, a body) nested somewhere inside a div.. Something like:
<div class=wrapper>
..
..
<body>
</body>
</div>
How would I go about selecting the body 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.
This should do the trick to locate the body tag –
When you don’t specify in your selector that you are talking about a class
.or id#attribute – the whole string will be matched to the type of element.The same could be done for –
<img>tags –$('div.wrapper').find('img')<a>tags –$('div.wrapper').find('a')<span>tags –$('div.wrapper').find('span')