I would like to keep my JavaScript and HTML code separate. To do this, I want to make sure that I never use the following syntax:
By assigning an ID to your input element, you will easily (and efficiently) be able to access it with raw javascript
In your separate javascript :
var input = document.getElementById("myInput");
input.onclick = function() {alert("clicked");}
Obviously you would do something more useful than an alert in the onclick function...