Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 30th, 2012  |  syntax: JavaScript  |  size: 0.95 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
  2. <title>button</title>
  3. <head>
  4. </head>
  5. <form name = buttons>
  6. <input class="move" type="radio"><br>
  7. <input class="move" type="radio"><br>
  8. <input class="move" type="radio"><br>
  9. <input class="move" type="radio"><br>
  10. <input class="move" type="radio">
  11. </form>
  12. </input>
  13. <script type="text/javascript">
  14.         var jump = document.getElementsByClassName("move");
  15.  
  16.         for (var i = 0; i < jump.length; i++) {
  17.                 jump[i].onclick = trans;
  18.                 jump[i].i = i;
  19.  
  20. }
  21.         function trans() {
  22.            if (jump[0].checked) {
  23.                 jump[0].type = "input";}
  24.            if (jump[1].checked) {
  25.                 jump[1].type = "number";}
  26.            if (jump[2].checked) {
  27.                 jump[2].type = "checkbox";}
  28.            if (jump[3].checked) {
  29.                 jump[3].type = "hidden";}
  30.            if (jump[4].checked) {
  31.                 jump[4].type = "password";}
  32.            if (jump[this.i].checked) {
  33.                 jump[this.i].value = "you do not have permission to view this area of the page";
  34.                 }
  35.         }
  36. </script>
  37. </html>