javascript anexando eventos
Eu vi que você pode anexar eventos como este
<code><button type="button" id="myButton" onclick="myFunction()"> </code>
você pode fazer o mesmo sem o"onclick="
, gostar:
<code>document.getElementById('myButton'). //and here attach the event on click to myFunction </code>
Eu estou tentando manter JavaScript e HTML separados.