<script type="text/javascript">
$(document).ready(function(){
$("#the_submit_button").click(function(){
e.preventDefault();
if $("representativepassword") == "sales"
$("protectivepanel").hide()
$("secretpanel").show()
});
});
</script>
我收到未捕获的语法错误,意想不到的标识
这里是我的嵌入的JavaScript
<script type="text/javascript">
$(document).ready(function(){
$("#the_submit_button").click(function(){
e.preventDefault();
if $("text") == "sales" <!--something here-->
$("protectivepanel").hide()
$("secretpanel").show()
});
});
</script>
我从未使用过jquery。我知道这是正确选择the_submit_button因为我已经尝试修改它将CSS。
这是我的引导形式
<div class="container" id="protectivepanel">
<form role="form">
<div class="form-group">
<label for="representativepassword">Representative's Password</label>
<input type="text" class="form-control" id="representativepassword" placeholder=" Enter Password">
<button type="submit" class="btn btn-default" id="the_submit_button">Submit</button>
</form>
<div>
我有我隐藏,一旦密码输入正确揭示出了巨大的容器。
目前容器看起来像这样
秘密的东西我已经试过
("input:sales"), ("representativepassword"), ("representativepassword)
语法错误?没有正确选择ID?
在jquery $(“text”)中说我想选择。为ID $('#ID')选择一个类$('。className') –
Huangism
我希望你明白,这是非常不安全的? –
我知道,我们只是想让它现在工作。 – Jngai1297