I have a simple script for animate. Its only one animate on web, so I want use only Javascript without Jquery for easy of it.
I have script:
var btn = document.getElementById("myBtn");
btn.onclick = function() {
modal.style.display = "block";
}
But I want use it on class and I need their id:
<a class="button" id="first"></a>
<a class="button" id="second"></a>
In Jquery I can write:
$('a.button').click(function() {
myId = $this.id();
...
modal.style.display = "block";
});
How I can write it in Javascript?
Thanks!
PS: Sorry for my English :-)