How to bring the class or method to scope in Different file Jquery
<p>Am having the below code to change the validation class at Runtime</p>

<pre><code>$("#txtNewAttributes").focusout(function () {
        var attributeTextBox = $("#txtNewAttributes").val()
        if ($.trim(attributeTextBox) == "Height")
            $(txtNewValues).removeClass('alphaonly').addClass('numbersonly');
        if ($.trim(attributeTextBox) == "IATA" || $.trim(attributeTextBox) == "IACA")
            $(txtNewValues).removeClass('numbersonly').addClass('alphaonly');
    });
</code></pre>

<p>And as Expected class name changes as i see in firebug. But the <strong>Numberonly</strong> class is not applied and the function is not working as it is Out Of SCope i thought as it is in a diff file as a function below</p>

<pre><code>function AllowOnlyNumbers() {
    $('.numbersonly').each(function (e) {
        $(this).keydown(function (e) {
            var key = e.charCode || e.keyCode || 0;
            return (key == 8 || key == 9 || key == 46 || (key &gt;= 37 &amp;&amp; key &lt;= 40) ||
                     (key &gt;= 48 &amp;&amp; key &lt;= 57) || (key &gt;= 96 &amp;&amp; key &lt;= 105));
        });
    });
}
</code></pre>

<p>How can i access the above function in my <strong>focusout</strong> Func in Jquery ?</p>

<p>Thanks</p>
