David
David

Reputation: 2721

what is the error for this statement written in jquery?

I am now writing javascript code, and one of the statement is :if(($(this).find("option").filter(":selected").length > 0). On Chrome and Firefox, it is ok. but on ie8, it keeps telling me that 'syntax error', some guy can help me with this?

ps: because of my carelessness, i wrote an extra $, i modified the above code. now the problem is right now.

Upvotes: 0

Views: 58

Answers (2)

Imdad
Imdad

Reputation: 6032

instead of $($(this)

use $(this)

Upvotes: 1

Sagiv Ofek
Sagiv Ofek

Reputation: 25270

you are having one extra ($

if($($(this).find("option").filter(":selected").length > 0)

should be

if ( $(this).find("option").filter(":selected").length > 0 )

Upvotes: 3

Related Questions