所有这些输入标签都在
下面的脚本无法运行。有人可以帮助我吗?
<form></form>
标记内。<input type="text" placeholder="username"><br />
<input type="text" placeholder="Name"><br />
<input type="text" placeholder="Lastname"><br />
<input id="mail" type="text" placeholder="E-mail"><br />
<input id="mail_1" type="text" placeholder="Re enter E-mail"><br />
<input id="password" type="password" placeholder="password"><br />
<input id="password_1" type="password" placeholder="Re enter password"><br />
<input id="submit" type="submit" value="registration">
下面的脚本无法运行。有人可以帮助我吗?
$("#submit").click(function(){
var email = $("#mail").val();
var email_1 = $("#mail_1").val();
var password = $("#password").val();
var password_1 = $("#password_1").val();
if (email != email_1){
$("#mail,#mail_1").css({"border":"1px solid red","background-color":"#FF9999"});
alert("wrong mail");
}
else{
$("#mail,#mail_1").css({"border":"1px solid green","background-color":"#C2FFC2"});
}
if (password != password_1){
$("#password,#password_1").css({"border":"1px solid red","background-color":"#FF9999"});
alert("wrong password");
}
else{
$("#password,#password_1").css({"border":"1px solid green","background-color":"#C2FFC2"});
}
});