how to use onclick in javascript html code example
Example 1: javascript button
<button onclick="Function()">Text</button>
Example 2: javascript onclick
var myElem = document.getElementByID('ElemID');
myElem.onclick = function() {
//do stuff
}
<button onclick="Function()">Text</button>
var myElem = document.getElementByID('ElemID');
myElem.onclick = function() {
//do stuff
}