Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script type="text/javascript">
- function doSomething(event, chkbox)
- {
- if (event.shiftKey)
- alert('Shift key was pressed while picking ' + chkbox.value);
- else
- alert('You picked ' + chkbox.value);
- }
- </script>
- </head>
- <body>
- <h3>Pick a Color</h3>
- <input type="radio" name="myColors" onclick="doSomething(event, this)" value="Red" /> Red<br/>
- <input type="radio" name="myColors" onclick="doSomething(event, this)" value="Green" /> Green<br/>
- <input type="radio" name="myColors" onclick="doSomething(event, this)" value="Blue" /> Blue<br/>
- </body>
- </html>
Add Comment
Please, Sign In to add comment