-1
On the page, who press key z opens my URL.
I don’t know if it’s possible, but I wish I didn’t have to Alt, Ctrl and/or Shift.
#teclas {display:none;}
<div id='teclas'>
<a accesskey='z' href='#zenphone'></a>
</div>
The code I’m using above has to press Alt+Z or something else on another browser or operating system, I wanted you to open this link with just pressing a letter or number from the keyboard.
It didn’t work here not, I tested in more than one browser, I put the number of the key codes and nothing
– Yasmin Gulosa
@Yasmingulosa troque
document.getElementById("teclas-z")[0]
fordocument.getElementById("teclas-z")
, fordocument.getElementById
returns only one element, no array, so[0]
is unnecessary.– Guilherme Nascimento
now worked without the [0] worth
– Yasmin Gulosa
@Guilhermenascimento Thank you.
– Cristiano Gilberto João
just missed to mark as right @Yasmingulosa
– Paz