Jquery return value

Posted by Anton on Stack Overflow See other posts from Stack Overflow or by Anton
Published on 2010-03-13T14:35:03Z Indexed on 2010/03/13 14:45 UTC
Read the original article Hit count: 135

Filed under:
|

I used a code:

jQuery.fn.MyFunction = function(){
return this.each(function() {
    attributes = "test";

    return attributes;
});}

But when I call

 var1 = $(this).MyFunction();alert(var1);

I got an [object], but not the "test".

How to allow jquery plugin return a some value?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript