26 lines
662 B
HTML
26 lines
662 B
HTML
<!DOCTYPE html>
|
|
|
|
<!-- Demonstrates DOMContentLoaded -->
|
|
|
|
<html lang="en">
|
|
<head>
|
|
<script>
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
document.querySelector('form').addEventListener('submit', function(e) {
|
|
alert('hello, ' + document.querySelector('#name').value);
|
|
e.preventDefault();
|
|
});
|
|
});
|
|
|
|
</script>
|
|
<title>hello</title>
|
|
</head>
|
|
<body>
|
|
<form>
|
|
<input autocomplete="off" autofocus id="name" placeholder="Name" type="text">
|
|
<input type="submit">
|
|
</form>
|
|
</body>
|
|
</html>
|