title: How to get the value of alt attribute of img tag?
body: <p>I cannot get the value of attribute alt of img tag</p>
  
  <p>Following is for Getting the value of attribute alt of img tag</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
  
  $('img').click(function () {
      var alt = $(this).attr("alt")
      alert(alt);
  });
  
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;img src="white.png" width="25px" height="25px" alt="1" id="star1" onmouseover="starOverOne()" onmouseout="starOutOne()"/&gt;
  </code></pre>
  
  <p>Here Nothing displayed in alertbox..Can you help me??</p>