Javascript handling for form started
This commit is contained in:
parent
48862df4a5
commit
b13a199098
1 changed files with 9 additions and 0 deletions
|
@ -24,4 +24,13 @@
|
||||||
<script>
|
<script>
|
||||||
document.getElementById('year').textContent = new Date().getFullYear().toString()
|
document.getElementById('year').textContent = new Date().getFullYear().toString()
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
const formEl = document.getElementById('register');
|
||||||
|
formEl.addEventListener('submit', (listener) => formHandler(listener));
|
||||||
|
|
||||||
|
function formHandler(listener){
|
||||||
|
listener.preventDefault();
|
||||||
|
alert("this works");
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</html>
|
</html>
|
Loading…
Reference in a new issue