Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- html5 input type required without a form. Does it work?
- <input type='text' required>
- <input id='name' type='text' required>
- <input id='surname' type='text' required>
- <input id='send' type='button' onclick ='send()'>
- function send() {
- if (document.getElementById('name').value == '') { alert('missing name'); return }
- if (document.getElementById('surname').value == '') { alert('missing surname'); return }
- // logic now...
- }
Advertisement
Add Comment
Please, Sign In to add comment