var myElem = document.getElementByID('ElemID'); myElem.onclick = function() { //do stuff }
<button onclick="Function()">Text</button>