When you use "this", it returns the standard JS DOM object.
But when you use $(this), it will return a jQuery object, which can
contain several DOM objects as well as functions and methods.

So if you want to use some jQuery methods on an object, you will have
to use $(this), but if you use standard JS stuff, you can use "this"
as you would with normal JS..

Hope it sheds some light on it.




On Jun 26, 3:02 pm, x-herbert <[EMAIL PROTECTED]> wrote:
> Hi jQueries;
>
> what is the different between this and $(this) ??
>
> I try the follow lines
>
> $("#form_zuw input[readonly]").each(function() {
>         this.addClass("input_readonly");
>
> });
>
> likehttp://jquery.bassistance.de/jquery-getting-started.html
>
> $(document).ready(function() {
>         // use this to reset several forms at once
>         $("#reset").click(function() {
>                 $("form").each(function() {
>                         this.reset();
>                 });
>         });
>
> });
>
> and Firebug say "addClass is not a Function"...???
>
> and this is running
>
> $("#form_zuw input[readonly]").each(function() {
>         $(this).addClass("input_readonly");
>
> });
>
> Can you explain the different?
>
> Thanks
> x-herbert

Reply via email to