title: jQuery get item parent
body: <p>I am trying to get the parent item of an item with the below code.</p>
  
  <p>(the content of the parent)</p>
  
  <p>ex. the parent of "Item 1.1" would be "Item 2" in the below example.</p>
  
  <p>Items:</p>
  
  <pre><code>        &lt;ul class="sortable" id="page-list"&gt;
  
              &lt;li&gt;&lt;div&gt;Item 1&lt;/div&gt;&lt;/li&gt;
              &lt;li&gt;&lt;div&gt;Item 2&lt;/div&gt;
                  &lt;ul&gt;
                      &lt;li&gt;&lt;div&gt;Sub Item 1.1&lt;/div&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;div&gt;Sub Item 1.2&lt;/div&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;div&gt;Sub Item 1.3&lt;/div&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;div&gt;Sub Item 1.4&lt;/div&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/li&gt;
  
          &lt;/ul&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>            function saveNewList() {
              //get DIV contents in order
              var divContents = [];
              $("ul.sortable &gt; li div").each(function() { divContents.push($(this).text()) });
              var quotedCSV = '"' + divContents.join('", "') + '"';
              $("#results").text(quotedCSV);
              //get DIV parents' contents in order
              var divParents = [];
              // something needs to go here...
              var quotedCSVparents = '"' + divParents.join('", "') + '"';
              $("#results2").text(quotedCSVparents);
  
  
          }
  </code></pre>