Your Ad Here

Posted By

omerta83 on 07/08/10


Tagged

javascript jquery


Versions (?)

Selecting elements within another element


 / Published in: JavaScript
 

  1. /*
  2. <div id="yourparent">
  3. <div id="mychild"> </div>
  4. </div>
  5. */
  6.  
  7. // Here are three ways to access an element within an element:
  8.  
  9. $('#yourparent').find('#mychild')
  10. //or even shorter:
  11. $('#mychild', $('#yourparent'))
  12. //or even shorter:
  13. $('#mychild', '#yourparent')
  14.  

Report this snippet  

You need to login to post a comment.