【发布时间】:2015-09-19 12:54:06
【问题描述】:
一旦我的 index.jsp 页面作为单击 regdata.jsp 页面上的登录按钮的响应加载,我正在尝试使用 id=regbutton 删除链接(我想将其设为按钮,请也提供帮助)
regdata.jsp
<script>
$(document).ready(function(){
$("button").click(function(){
$("#mainDiv").load("index.jsp");
$('#regButton').remove();
});
});
</script>
</head>
<body>
<div id="mainDiv" class="units-row">
<h2>Thanks For registering!</h2>
<button id="regLogin">Login Now</button>
</div>
index.jsp
<body>
<center>
<s:actionerror />
<h1 id="login_title"></h1>
<form action="checkLogin.action" method="post">
<p>
<input type="text" id="username" name="username"
placeholder="" >
</p>
<p>
<input type="password" name="password"
placeholder="" id="password">
</p>
<label> <input type="checkbox" name="remember_me" id="remember"><label for="remember" id="rememberlbl"></label></label>
</p>
<input type="submit" class="btn-log" method="execute"
key="label_login">
</form>
<a href="registerLogin.action" id="regButton">Register</a>
</center>
</body>
【问题讨论】:
-
在 ('#regButton') 之前缺少 $
-
试过还是不行
标签: javascript jquery html ajax jsp