When I click the submit button, it causes refresh page! But after I delete the tag, it works well.What,s the problem of this, how can I avoid this problem without deleting the tag, the codes are as follows:
<script language="javascript" type="text/javascript">
function password() {
var word = document.getElementById("password");
var load = document.getElementById("display");
if(word.type=="password"){
word.type = "text";
load.value = "hidden"
}
else{
word.type = "password";
load.value = "display";
}
}
</script>
<form>
<input type="password" name="password" value="password" id="password" />
<input type="submit" name="display" onclick="password()" value="display" id="display"/>
</form>