<input type='text' name='one' id='oneID' maxlength="150">
i need the JS to display the number of characters left that user can input
a picture is worth a 1000 words so no more explanation required...
<input type='text' name='one' id='oneID' maxlength="150">
i need the JS to display the number of characters left that user can input
a picture is worth a 1000 words so no more explanation required...
Bind a function to the onkeyup
event that counts the number of characters entered and displays how much is remaining.
Example:
var e = document.getElementById('oneID'),
f = document.getElementById('countDiv'); // some element where the count will be displayed
e.onkeyup = function() {
f.innerHTML = (e.maxLength - e.value.length) + ' characters remaining';
}