0

I am looking at the jquery watermark plugin and i cant seem to understand whats going on... First off what does the fn mean and where is WatermarkColor being defined...ins not in this file

$.fn.Watermark = function(text,color) {
    if(!color)
        color="#2D2D2D";
    return this.each(
        function(){     
            var input=$(this);
            var defaultColor=input.css("color");
            map[map.length]={text:text,obj:input,DefaultColor:defaultColor,WatermarkColor:color};
            function clearMessage(){
                if(input.val()==text)
                    input.val("");
                input.css("color",defaultColor);
            }
Matt Elhotiby
  • 43,028
  • 85
  • 218
  • 321
  • 1
    possible duplicate of [What does jQuery.fn mean?](http://stackoverflow.com/questions/4083351/what-does-jquery-fn-mean). – BalusC Dec 02 '10 at 20:45

1 Answers1

3

fn is a shortcut to prototype that jQuery sets up. WatermarkColor is whatever color is entered into the Watermark function, or it defaults to #2D2D2D.

Sean Vieira
  • 155,703
  • 32
  • 311
  • 293