Glad I could be of assistance, Harvey.

Yes, you can put anything into a variable! :-)

It's especially useful to save a jQuery object in a variable as in this
code:

var $input = $("[id$="+b1+"] input");
$input.val( $input.val() == "Hide" ? "Show" : "Hide" );

This way the fairly expensive search that jQuery does to match the selector
only has to be done once, instead of twice. And it makes the code easier to
follow too!

-Mike

On Sat, Oct 10, 2009 at 11:05 AM, hsfrey <hsf...@gmail.com> wrote:

>
> Michael:
>
>    Yes, Indeed! That works perfectly! Thank you!
>
>   And it seems so simple and obvious in retrospect. <g>
>
>   Actually, I hadn't realized that I could put the selector into a
> variable and reuse it that way, so you've taught me something else
> new.
>
> Harvey
>
>
>

Reply via email to