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