jQuery: The Write Less, Do More JavaScript Library

Re: 2 different ways of doing the same thing?

by mkmanning :: Rate this Message:

Reply to Author | View in Thread


>Would this not be 2 different ways to do the same thing?

Yes and no.
The first finds all inputs and excludes checkboxes, returning the
result in the jQuery object.
The second finds all inputs and returns them to the jQuery object,
then excludes those that are checkboxes.

WIth the latter, you can chain .end() and revert to the original
selection of all inputs including checkboxes.



On Jul 2, 9:11 am, expresso <dschin...@...> wrote:
> Would this not be 2 different ways to do the same thing?
>
> $('input:not(:checkbox));
>
> vs.
>
> $('input').not(:checkbox);

 « Return to Thread: 2 different ways of doing the same thing?