sure, but dont add the if statement around the div, and add a style to set it to hidden by default:
<style type="text/css">
.confirm { display: none; }
</style>
<div class="confirm" id="confirm">Please check your forms for errors.</div>
then use this for the onclick:
onclick="window.scrollTo(0, 0);document.getElementById('confirm').style.display = 'block';"


