我忘了密码链接。点击链接我想显示一个div。这是我的演示代码。有一些我想念的东西。 JSP代码:
<form action="login" method="post">
<label>Username :</label>
<input type="text" value="" name="email">
<label>Password :</label>
<input type="password" value="" name="password">
<input class="submit" type="submit" value="Login" name="Login">
<div id="link" class= "link">Forgot Password?</div>
</form>
<div id="forget-details" class = "forget-details">
<h1>Forgot Your Password</h1>
<p>Enter your registered email address and we will send you a link to reset your password.</p>
<input type="text" value="" name="email" placeholder = "Enter your registered email"/>
CSS:
form div.link{
color: #44869b;
cursor: pointer;
font-family: DIN,Helvetica,Arial,sans-serif;
font-size: 12px;
margin-top: 105px;
text-transform: inherit;
}
.forget-details {
background-color: #333;
float: right;
margin: 7px 0;
padding: 11px;
width: 97%;
display:none;
}
Jquery的:
$(document).ready(function(){
$(".link").click(function(){
$(".forget_details").show();
});
});
答案 0 :(得分:3)
您有class="forget-details"
(超级),但随后选择$(".forget_details")
(下划线)
答案 1 :(得分:0)
将您的班级名称更改为forget_details
或进行此更改
$(".forget-details").show();