this is my HTML:
<div class="tool-top">
<ul>
<li><a role="button" id="button" value="bold"><i class="fas fa-bold"></i></a></li>
<li><a role="button" id="button" value="italic"><i class="fas fa-italic"></i></a></li>
</ul>
</div>
this is my JS:
window.onload = function(){
document.getElementById('button').onclick = function(){
var a = this.getAttribute('value');
console.log(a);
}
}
I get 'bold' when clicking the first button but nothing in the second
I looked on this page, but it wrote with Jquery.