$(function(){ 
  //焦点放在第一个文本输入框
  $('input:text:first').focus(); 
  //获取所有的输入框
  var $inp=$('input');
  //定义所有输入框的案件事件
  $inp.keypress(function(e){
    var key=e.which;
    if(key==13){
      $(this).css("color","red");
    }
  }) 
})


 posted on 2017-01-07 13:49  ChaseForFuture  阅读(433)  评论(0编辑  收藏  举报