Listener set up to form and default skipped
Signed-off-by: Eoghan Conlon <eoghanconlon73@skynet.ie>
This commit is contained in:
parent
b3531da019
commit
6ba509f8bd
1 changed files with 9 additions and 0 deletions
|
@ -20,5 +20,14 @@
|
|||
<script>
|
||||
document.getElementById('year').textContent = new Date().getFullYear().toString()
|
||||
</script>
|
||||
<script>
|
||||
const formEl = document.getElementById("form");
|
||||
formEl.addEventListener('submit', formHandler);
|
||||
|
||||
function formHandler(listener){
|
||||
listener.preventDefault();
|
||||
alert("Default skipped");
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue