Coding Global Background
Coding Global

'alert' function not working

Archiviert 3 years ago
4 Nachrichten
2 Mitglieder
3 years ago
In Discord öffnen
L
ignite
Verified

```html <DOCTYPE html> <html lang="en"> <title>Hello</title> <script> document.addEventListener('DOMContentLoaded', function() { document.querySelector('form').addEventListener('submit') = function() { const name = document.querySelecter('#name').value; alert(`Hello, ${name}!`); }; }); </script> </html> <body> <h1>Hello!</h1> <form> <input autofocus id="name" placeholder="Name" type="text"> <input type="submit"> </form> </body> </DOCTYPE> ```

Antworten (4)