I have two buttons
and one function
called 'starta' and it has parameter
'oi'.
My question is shouldn't the button
with id of 'ooii' just work and not both of them ? Could somebody explain the reason both of these buttons are working ?
function starta(oi) {
document.getElementById(oi).style.backgroundColor = "green";
}
button.rond {
width: 60px;
height: 60px;
}
<table><tr><td class="np"><button style="background-color:yellow" id="y" class="rond" onclick="starta('y')">alotus</button></td></tr><tr><td class="np"><button style="background-color:yellow" id="ooii" class="rond" onclick="starta('ooii')">alotus</button></td></tr></table>