+ 3
How can I do this...?
https://code.sololearn.com/WaHVAVVG08Wh/?ref=app How can I restrict the <text area> characters upto 140 characters? When the user wants to add more than 140 characters, an alert box will pop up and the characters will not be typed.
8 Réponses
+ 2
yup..
as
<textarea maxlength="140"></textarea>
+ 4
thanks
+ 2
In HTML?
+ 2
An alert box to pop up before stopping to type the more than 140 characters..?
+ 1
use maxlength attribute to limit character length
+ 1
And the alert box?
+ 1
are you using jQuery??
if so then
$( "textarea" ).on('input', function() { if ($(this).val().length>140) { alert('you have reached a limit of 140 characters'); } });
0
what changes to alert box??