- Create one textarea and one button. On click of the button the length of text entered inside the textarea will be displayed.
- In the above code show the counter as and when text is entered.
- Use one progress bar for showing the number of text entered.
Solution:
HTML
<textarea name=t1 rows=3 id=t1 class=form-control></textarea>
<button type='button' class='btn btn-danger' id=my_b1>Count</button>
<div id=display1></div>
JQuery
<script>
$(document).ready(function() {
$("#my_b1").click(function(){
var my_str=$('#t1').val();
$('#display1').html(my_str.length)
})
})
</script>
In the above code show the counter as and when text is entered.
HTML
<textarea name=t2 rows=3 id=t2 class=form-control></textarea>
<div id=display2></div>
JQuery
<script>
$(document).ready(function() {
$('#t2').keyup(function(){
var my_str2=$('#t2').val();
$('#display2').html(my_str2.length)
})
})
</script>
Use one progress bar for showing the number of text entered.