You can do this with javascript, copy paste the below script under the <head></head> tag in your .htm.
<script type="text/javascript">
window.onbeforeunload = function (event) {
var message = 'Important: Please click on \'Save\' button to leave this page.';
if (typeof event == 'undefined') {
event = window.event;
}
if (event) {
event.returnValue = message;
}
return message;
};
</script>
Javascript is a client side script while BSP ABAP events are server based. See if you can achieve what you need to with client side scripting otherwise you will need to call server event from javascript.