Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>dom1</title>
- </head>
- <body>
- <form id="demo">
- <input id="name" placeholder="Name" type="text"/>
- <input type="submit"/>
- </form>
- <script>
- document.getElementById('demo').onsubmit = function() {
- alert('hello, ' + document.getElementById('name').value + '!');
- return false;
- };
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement