user1115921
user1115921

Reputation:

jquery method showing error

I've this in a page

       $(".dsd").click(function(){

When i used firebug,it gives me this error

     $(".dsd").click is not a function

What is this?

Upvotes: 0

Views: 39

Answers (3)

Daniel Lidström
Daniel Lidström

Reputation: 10290

Try

$(".dsd").each(function () {
    $(this).click(function () { ... });
});

Upvotes: 0

Simon Edström
Simon Edström

Reputation: 6619

Its seems to be a conflict in my point of view. You have a libary that also want the shortcode $. Have a look at jQuery.noConflict and try to use jQuery(".dsd").click...

Upvotes: 0

Darin Dimitrov
Darin Dimitrov

Reputation: 1039538

This could be due to a conflict with some other client framework you might be using which has hijacked the $ function. Take a look at jQuery.noConlict for possible solutions about how you could use jQuery with other frameworks.

Upvotes: 1

Related Questions