Wednesday, 5 May 2021

JQUERY9

 <html>

<head>

<script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

<script>

var maxLength = 15;

$('textarea').keyup(function() {

var textlen = maxLength - $(this).val().length;

$('#max').text(textlen);

});

</script>

<style type="text/css">

textarea {

display:block;

margin:1em 0;

background-color:pink;

} 

</style> 

</head>

<body>

<form>

<center>

<label>Maximum 15 characters</label>

<textarea id="textarea" maxlength="15"></textarea>

<span id="max">15</span> Character(s) Remaining

</center>

</form>

</body>

</html>