title: How to change the id of deep nested elements with jQuery
body: <p>I have this recursive code that transverses the DOM and adds a prefix to the id for all input tags.</p>
  
  <p>I would like to change this to a more elegant jQuery, but I'm not sure how to structure the selectors or if the selectors need to be recursive..</p>
  
  <p>cheers, </p>
  
  <pre><code> function set_inputs(obj, prefix){
    for (var s=0;s&lt; obj.childNodes.length; s++){
      var node = obj.childNodes[s];
      if(node.tagName == "INPUT"){
        node.id= prefix +'_' + node.id;
        node.name= prefix +'_' + node.name;
      }
      else{
        set_inputs(node,prefix);
      }
    }
  }
  </code></pre>