我不知道问题是什么,但是 JavaScript 没有被执行!我尝试了很多次,但我没有看到任何错误。
<html>
<head>
<title>Log In Page</title>
<script>
function myf()
{
document.getElementById("name").disabled=true;
document.getElementById("reason").disabled=true;
document.getElementById("register").disabled=true;
document.getElementById("link").display="inline";
alert("You have successfully registered.");
}
</script>
</head>
<body bgcolor="black">
<center><h1 style="font-family:Agency FB;font-size:100px;color:#3333FF;letter-spacing:50px;text-shadow: 10px 10px 10px #FF9933;">My Profile</h1></center>
<center><p style="font-family:Ubuntu Mono Bold;color:#3333FF;">You are requested to FILL IN these particulars.</p></center>
<font color="#07C6F6" face="Arial">
<center>Enter Your Name:<input type="text" id="name"><br><br>
Why Do You Want to See This Profile:<input type="text" id="reason"><br></center>
</font>
<br>
<br>
<center><button type="button" id="register" onClick="myF()">Register Info</button><br>
<p id="link" style="font-family:Arial;display:none;"><a href="Profile.html">View Profile</a></p></center>
</body>
</html>