Type up to 50 characters. The count updates for typing, paste and other input methods.
<textarea name="t1"
rows="4"
class="form-control"
id="t1"
maxlength="50"></textarea>
<div id="d1" aria-live="polite">0 / 50</div>
$( "#t1" ).on( "input", function () {
const length = $( this ).val().length;
$( "#d1" ).text( length + " / 50" );
});
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.