views:

87

answers:

3

In jQuery, what does $.fn. mean? I looked this up on google but couldn't find any concrete examples.

$.fn.something = function{}
+3  A: 

It allows you to extend jQuery with your own functions.

For example, $.fn.something = function{} will allow you to use $("#element").something().

$.fn is also synonymous with jQuery.fn which might make your Google searches easier.

See jQuery Plugins/Authoring

Paperjam
makes perfect sense! thanks man! I LOVE THIS WEBSITE
anthonypliu
mark some answers (like this one) to your question as "accepted" (checkmark), and this website will love you back. :)
quixoto
+1  A: 

See Plugins/Authoring

rahul
+1 Wow, pounced on with four similar answers. Deleting mine and upvoting the one closest to it.
Ken Redler
Hey now, I beat him by 27 seconds ;)
Paperjam
+1  A: 

This has been covered in some detail here:

http://stackoverflow.com/questions/1755080/why-jquery-do-this-jquery-fn-init-prototype-jquery-fn

But the short of it is that $.fn is an alias for $jQuery.prototype

Warren