In jQuery, what does $.fn. mean?

JqueryJquery Plugins

Jquery Problem Overview


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

$.fn.something = function{}

Jquery Solutions


Solution 1 - Jquery

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

Solution 2 - Jquery

This has been covered in some detail here:

https://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

Solution 3 - Jquery

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionanthonypliuView Question on Stackoverflow
Solution 1 - JqueryChad LevyView Answer on Stackoverflow
Solution 2 - JqueryWarren RumakView Answer on Stackoverflow
Solution 3 - JqueryrahulView Answer on Stackoverflow