Posted By

linusx on 05/13/10


Tagged

elements jquery walk


Versions (?)

Walk all DOM elements with jQuery


 / Published in: PHP
 

This code will walk all elements from a given selector.

  1. function doStuff(child, type) {
  2. if(typeof type !== 'undefined' && type != ""){
  3. /** HERE **/
  4. }
  5. }
  6.  
  7. function walk(children){
  8. if (typeof children == "undefined" || children.size() === 0) {
  9. return;
  10. }
  11.  
  12. children.each(function(){
  13. var child = $(this);
  14. if (child.children().size() > 0) {
  15. walk(child.children());
  16. }
  17. doStuff(child, this.type);
  18. });
  19. }
  20.  
  21. walk($("#ka-registration-vital-information-form .participant"));

Report this snippet  

You need to login to post a comment.