Wednesday, 11 September 2013

Change input value onclick button - pure javascript or jQuery

Change input value onclick button - pure javascript or jQuery

I have two buttons and if I click on some button I need to change value in
input text and change total price (product price * value of button - 2 or
4 Qty). I know that it's simple but I'm not good in javascript or jQuery.
Answer in jsfiddle would be best. My jsfiddle is here
http://jsfiddle.net/J7m7m/1/
My simple code:
Product price: $500
<br>
Total price: $500
<br>
<input type="button" onclick="change()" value="2&#x00A;Qty">
<input type="button" value="4&#x00A;Qty">
<br>
Total <input type="text" id="count" value="1">

No comments:

Post a Comment