how to set onclick event of a button using javascript in html code example Example: javascript button <button onclick="Function()">Text</button>