Wednesday, 15 February 2012

javascript - Blog editing problems -



javascript - Blog editing problems -

i novice blogger , wanted create counter on blog increment value when button click far after searching long on web came result

<script src="http://code.jquery.com/jquery-1.4.3.min.js"></script> <script> $(document).ready(function(){ $('#addbutton').click( function() { var counter = $('#textbox').val(); counter++ ; $('#textbox').val(counter); }); }); </script>

now need people may click on button twice want create sure person clicks 1 time browser , value should saved @ to the lowest degree on text box other people, please help me...

use 1 alternative prevent multiple click.

<script src="http://code.jquery.com/jquery-1.4.3.min.js"></script> <script> $(document).ready(function(){ $('#addbutton').one( "click", function() { var counter = $('#textbox').val(); counter++ ; $('#textbox').val(counter); }); }); </script>

javascript jquery html counter

No comments:

Post a Comment