jquery - Javascript multiply on click -
i want have default value (10 example) , button increase same value on every click.. can't script work
<div id="output">10</div> <div id="increase">increase</div> <script> $('#increase').click(function() { var 1 = $('#output').val(); var increase = 10; var output = +one + increase; $('#output').val(output.tofixed(2)); document.getelementbyid('output').innerhtml = value; }); </script>
include jquery , set try code:
$('#increase').click(function() { var 1 = $('#output').text(); var increase = 10; var output = number(one) + increase; $('#output').text(output.tofixed(2)); });
take @ number(one)
, convert string number.
edit use .text() function get/set value div.
Comments
Post a Comment