解决方案就是把this改成$(this)让this成为jquery对象
this是指向正在运行函数的对象.
今天用jquery来写一个聚焦事件,直接调用this.css()出现错误this.css is not a function.原因就是
只有jquery对象才能调用jquery方法.
//input获取焦点事件
$('.loginmianbox input').focus(function(){
$(this).css({
outline:'2px solid blue',
border:'none'
})
})