title: Access parent element by variable using jquery
body: <pre class="lang-js prettyprint-override"><code>var _div = $("&lt;div id='ds-tree-expand'/&gt;").appendTo( "#ds-subject-tree" );
  var _cur_token = "susmita";
  var _next_token = "sudipta";
  
  for(var i=0; i&lt;5; i++){
      var _1st_level = $( "&lt;p id='acc_trigger' class='active collapsed'&gt;" + _cur_token + "&lt;/p&gt;" ).appendTo(_div);
      var _2nd_level = $( "&lt;p id='2nd_trigger' class='active collapsed'&gt;" + _next_token + "&lt;/p&gt;" ).appendTo(_1st_level);
  }
  
  var _2nd_ch = _div.children().children();
  </code></pre>
  
  <p>Now I want to access the <strong>parent</strong> of each <code>_2nd_ch</code> element.
  I have tried:</p>
  
  <pre class="lang-js prettyprint-override"><code>$(_2nd_ch[1]).parent();
  </code></pre>
  
  <p>This isn't working.  How can I access the <strong>parent</strong> of each item of the <code>_2nd_ch</code> array?</p>