declaring jQuery objects with the $foo pattern

Eli Cochran eli at
Thu Aug 21 18:40:19 UTC 2008

There is a little discussion on the jQuery Google Group about using $  
when declaring variables that contain a jQuery object.


	var $foo = $("div");

instead of just:

	var foo = $("div");

Any opinions.

I have a case, in the scroller, were I have to refer to an element  
both as a jQuery object and a DOM object (because jQuery doesn't  
support the method that I need) and it would make the code perhaps  
clearer... at least to those who know the convention. Perhaps more  
confusing to those who don't.

- Eli

. . . . . . . . . . .  .  .   .    .      .         .              .                     .

Eli Cochran
user interaction developer
ETS, UC Berkeley

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the fluid-work mailing list