title: Dynamic create ul li with array in Jquery
body: <p>I am trying to create a ul > li dynamically in jquery.</p>
  
  <p>I have this data:</p>
  
  <pre><code>var nodeDataArray = [{
      key: 0,
      name: "George V"
  }, {
      key: 1,
      parent: 0,
      name: "Edward VIII"
  }, {
      key: 2,
      parent: 0,
      name: "George VI"
  }, {
      key: 7,
      parent: 2,
      name: "Elizabeth II"
  }];
  </code></pre>
  
  <p>My HTML structure is below:</p>
  
  <pre><code>&lt;ul&gt;
      &lt;li&gt;List 1
          &lt;ul&gt;
               &lt;li&gt;Sub List 1&lt;/li&gt;
               &lt;li&gt;Sub List 2&lt;/li&gt;
               &lt;li&gt;Sub List 3
                   &lt;ul&gt;
                       &lt;li&gt;Sub Sub List 1&lt;/li&gt;
                       &lt;li&gt;Sub Sub List 2&lt;/li&gt;
                       &lt;li&gt;Sub Sub List 3&lt;/li&gt;
                       &lt;li&gt;Sub Sub List 4&lt;/li&gt;
                   &lt;/ul&gt;
               &lt;/li&gt;
          &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;List 1&lt;/li&gt;
      &lt;li&gt;List 1&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>There are thousands of Ul > li which i want to create. I want some dynamic way like array or in loop to create these type of lists.</p>
  
  <p>Please help.</p>
  
  <p>Thanks in Advance</p>