You should really have a fall back plan in place for if JavaScript is disabled. The best and easiest way to do this is target the relevant event property (onClick) and place Salathe's code onto the button element dynamically, thus if JS is disabled, it'll cruise past it. Ideally to a standard HTML page where you can confirm the deletion.
Code:
<form action="Test/">
<input type="submit" id="elementName" />
</form>
<script type="text/javascript">
addEvent(window, 'load', initFunc, false);
function addEvent(element, eventType, callFunction, useCapture)
{
if(element.addEventListener)
element.addEventListener(eventType, callFunction, useCapture);
else if(element.attachEvent)
element.attachEvent('on'+eventType, callFunction);
}
function initFunc()
{
element = document.getElementById('elementName');
element.onclick = function() { return doConfirm(); };
}
function doConfirm()
{
var pConfirm = confirm('Delete?');
if (pConfirm)
return true;
return false;
}
</script>