开发者

What is wrong with this jquery?

Here is some jQuery I have coded:

$(function () {

$('input').click(function() {

$(this).css("background", "-webkit-gradient(linear,left top,left bottom,from(white),to(#DDD))");

)};

)};

I am getting a console err开发者_如何学JAVAor of syntax error at the first )};. I will probably bang my head against the wall for the next hour because I missed some ridiculously simple bug... but O well thats better than doing that and not finding the bug.


$(function () {

$('input').click(function() {

  $(this).css("background", "-webkit-gradient(linear,left top,left bottom,from(white),to(#DDD))");

});

});

You had the parenthesis and curly braces reversed on the last 2 lines!


There are two syntax errors:

  1. Change this )}; to this });, in last row
  2. Change this )}; to this });, in pre-last row

:)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜