文章出处:http://blog.csdn.net/lvhuiyang/article/details/53192277
//未填写的input 边框变红色
$('input[type=text]').each(function(i,v){
$(v).blur(function(){
if($(v).val() == ''){
$(v).css('border-color','red');
$(v).focus();
}else{
$(v).css('border-color', '#ece9e9');
}
})
})
required 使用
队伍名称
html的默认方式提交
重置
这一种提交方式无话可说,需要注意的是form标签内的 action属性负责提交的地址,method是提交的方式(get/post)。
2. 使用jquery进行控制
有时候我们需要对账号密码的输入进行控制,比如要判断输入框是否为空,为空的话进一步提醒用户。为了方便使用jQuery进行操作,如下:
$(document).ready(function () {
$("#submit_button").click(function () {
var username = $('.username').val();
var password = $('.password&#