document.getElementById('confirm').onclick = function () { alert('click me') }
<input type="button" id="confirm" name="confirm" value="确认">