I\'ve seen that you can attach events like this
can you do the same
document.getElementById('myButton').onclick = function() { myFunction(); }