I'm trying to give disabled on all buttons with the same name, however it does not work, what am I doing wrong?
//HTML BOTÃO QUE EU QUERO DESATIVAR
<button class="teclado" id="Q" name="nameTeclado" onClick="forca(this.id);">Q</button>
//HTML BOTÃO QUE ESTOU USANDO PARA DESATIVAR
<button onClick="teste();">teste</button>
//JS
function teste() {
document.getElementsByName("nameTeclado").disabled = "true";
}
There are many buttons that I need to disable at once, so I can not do with get.elementById (which in case works)