Passing textbox as an instance in jQuery
<pre><code>var ctrl = $("&lt;input /&gt;").decimalControl(AllowedDecimalValues).ControlContainer();
$.fn.decimalControl = function (Decimalvalues) {
    var settings = {
        'maxLength': '25',
        'defaultvalue': '00.00',
        'name': 'decimalcontrol',
        'type': 'number'
    };
    settings.MaxDecVal = Decimalvalues;
    return $(this).ControlBuilder(settings);
};
$.fn.ControlBuilder = function (settings) {
    return this.val(settings.defaultvalue)
        .attr('name', settings.name)
        .attr('value', settings.defaultvalue)
        .attr('type', settings.type)
        .attr('size', settings.maxLength);
};
</code></pre>

<p>The first line of the above code throws an error:</p>

<pre><code>Object doesn't support property or method 'decimalControl'.
</code></pre>

<p>Please provide help or a alternate solution.</p>
