chromedude
chromedude

Reputation: 4302

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 error 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.

Upvotes: -1

Views: 62

Answers (2)

Topera
Topera

Reputation: 12389

There are two syntax errors:

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

:)

Upvotes: 2

David Fells
David Fells

Reputation: 6798

$(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!

Upvotes: 4

Related Questions