
Untitled
By: a guest on
Apr 30th, 2012 | syntax:
JavaScript | size: 0.95 KB | hits: 19 | expires: Never
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<title>button</title>
<head>
</head>
<form name = buttons>
<input class="move" type="radio"><br>
<input class="move" type="radio"><br>
<input class="move" type="radio"><br>
<input class="move" type="radio"><br>
<input class="move" type="radio">
</form>
</input>
<script type="text/javascript">
var jump = document.getElementsByClassName("move");
for (var i = 0; i < jump.length; i++) {
jump[i].onclick = trans;
jump[i].i = i;
}
function trans() {
if (jump[0].checked) {
jump[0].type = "input";}
if (jump[1].checked) {
jump[1].type = "number";}
if (jump[2].checked) {
jump[2].type = "checkbox";}
if (jump[3].checked) {
jump[3].type = "hidden";}
if (jump[4].checked) {
jump[4].type = "password";}
if (jump[this.i].checked) {
jump[this.i].value = "you do not have permission to view this area of the page";
}
}
</script>
</html>