Solution for Exercises on JQuery

  1. Create one textarea and one button. On click of the button the length of text entered inside the textarea will be displayed.
  2. In the above code show the counter as and when text is entered.
  3. 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.




Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com



    Post your comments , suggestion , error , requirements etc here .







    Most Popular JQuery Scripts

    1

    Two dependant list boxes

    2

    Calendar with Date Selection

    3

    Data change by Slider

    4

    Show & Hide element


    JQuery Video Tutorials




    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer