精简javascript

// 糟糕

 
$first.click(function(){
    $first.css('border','1px solid red');
    $first.css('color','blue');
});
 
// 建议
 
$first.on('click',function(){
    $first.css({
        'border':'1px solid red',
        'color':'blue'
    });
});
原文地址:https://www.cnblogs.com/ln0218/p/3802458.html