title: show button class name on click using javascript
body: <p>Hi i have a requirement where i need to show the class name of button which has been clicked using <code>java script</code>. there are many buttons with different class names.Any suggestion?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript"&gt;
  function myFunction()
  {
  var container = document.getElementById(id);
  alert (container);
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  
  &lt;button class="A" id="A" onclick="myFunction()"&gt;A&lt;/button&gt;
  &lt;button class="B" id="B" onclick="myFunction()"&gt;B&lt;/button&gt;
  &lt;button class="C" id="C" onclick="myFunction()"&gt;C&lt;/button&gt;
  &lt;button class="D" id="D" onclick="myFunction()"&gt;D&lt;/button&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>