title: How to get the html List value through JavaScript?
body: <p>I am trying to get values from html list <code>&lt;li&gt;</code>.</p>
  <pre><code>&lt;ul&gt;
      &lt;li&gt;&lt;a&gt;Main Menu&lt;/a&gt;
          &lt;ul class=&quot;leftbutton&quot; &gt;
              &lt;li value=&quot;List1&quot;&gt;&lt;a&gt;Sampe 1&lt;/a&gt;&lt;/li&gt;
              &lt;li value=&quot;List2&quot;&gt;&lt;a&gt;Sample 2&lt;/a&gt;&lt;/li&gt;
              &lt;li value=&quot;List3&quot;&gt;&lt;a&gt;Sample 3&lt;/a&gt;&lt;/li&gt;
              &lt;li value=&quot;List4&quot;&gt;&lt;a&gt;Sample 4&lt;/a&gt;&lt;/li&gt;
              &lt;li value=&quot;List5&quot;&gt;&lt;a&gt;Sample 5&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/li&gt;
  &lt;/ul&gt; 
  
  &lt;iframe id=&quot;iframeid&quot; width=&quot;100%&quot; height=&quot;100%&quot; align=&quot;middle&quot;&gt;&lt;/iframe&gt; 
  
  function changeList()
  {
      var iframe = document.getElementById(&quot;iframeid&quot;);  
      var url = document.getElementById(&quot;selectedlist&quot;).value + &quot;.html&quot;; 
      iframe.src = url;
  }
  </code></pre>
  <p>Where would I put <code>onClick=&quot;changeList()&quot;</code> to get the values from the list?</p>