Advertisement
alienxp03

onChange javascript

Aug 8th, 2012
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.45 KB | None | 0 0
  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function changeText()
  5. {
  6.     var selected = document.form1.sel.value;
  7.     document.form1.txtInput.value = "You have selected "+;
  8. }
  9. </script>
  10. </head>
  11. <body>
  12. <form name="form1">
  13. <select name="sel" onChange=changeText()>
  14. <option value="A">A</option>
  15. <option value="B">B</option>
  16. <option value="C">C</option>
  17. <option value="D">D</option>
  18. </select>
  19. <input type="text" name="txtInput" />
  20. </form>
  21. </body>
  22. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement