Javascript handling for form started

This commit is contained in:
eoghan.conlon 2023-08-07 18:23:20 +01:00
parent 48862df4a5
commit b13a199098

View file

@ -24,4 +24,13 @@
<script>
document.getElementById('year').textContent = new Date().getFullYear().toString()
</script>
<script>
const formEl = document.getElementById('register');
formEl.addEventListener('submit', (listener) => formHandler(listener));
function formHandler(listener){
listener.preventDefault();
alert("this works");
}
</script>
</html>