title: How to get the ul li values using Javascript
body: <p>i would like to take the value of an li in alert box using javascript.(i.e If i click on PHP it should alert php in alert box). But its showing undefined. Please anyone help on this.</p>
  
  <p>My code is </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function lang1()
      {
      var a = document.getElementsByTagName("li").value;
      alert(a);
      }
  &lt;/script&gt;
  
  &lt;form&gt;
      &lt;ul id="language" onclick="lang1();"&gt;
          &lt;li&gt;PHP&lt;/li&gt;
          &lt;li&gt;ASP&lt;/li&gt;
          &lt;li&gt;JAVA&lt;/li&gt;
          &lt;li&gt;CQ5&lt;/li&gt;
      &lt;/ul&gt;     
  &lt;/form&gt;
  </code></pre>