I'm currently writing a Greasemonkey script to add an onclick event to an existing button, to show a confirmation popup window.
This is the existing html:
<input type="button" id="previewOrder" title="" class="ui-button ui-widget ui-state-default ui-corner-all" role="button" aria-disabled="false" value="Preview Order">
I came up with the following javascript but it does not work or fails
function confirm () {
alert ("Sure?");
}
document.getElementById("previewOrder").addEventListener("click", confirm(), false);
Any suggestions on how to get this working?