Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id='testDiv'>ddd
- <div class='test'> 111<div> another div </div></div>
- <div class='test'> 222</div>
- <div class='test'> 333</div>
- more...
- </div>
- if($('#testDiv.test').length>5){
- alert('haha');
- }
- $('#testDiv .test').length
- if( $('#testDiv .test').length > 5 ){
- alert('haha');
- }
- $('#testDiv .test').length
- $('#testDiv.test') //- element with ID testDiv and class test
- //<div id="testDiv" class="test">...</div>
- <div id="testDiv" class="test">
- $('#testDiv .test")
- ^--- note the space
- $('#testDiv').children('.test').length;
- $("#testdiv").children(".test")
- $("#testdiv .test")
- $("#testdiv.test")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement