How can I pass a control as a function attribute? In my case I would like to pass txtDirections and charStatus.
Thanks
$(document).ready( function () {
$( '.txtDirections' ).keyup( function ()
{
var maxLength = 1000;
var textlength = this .value.length;
if (textlength >= maxLength) {
$( '#charStatus' ).html( 'You cannot write more then ' + maxLength + ' characters!' );
this .value = this .value.substring(0, maxLength);
e.preventDefault();
}
else {
$( '#charStatus' ).html( 'You have ' + (maxLength - textlength) + ' characters left.' );
}
});
});