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
using html5 data attribute...
try this
Html
Product price: $500 Total price: $500 Total
JS
$(function(){ $('input:button').click(function () { $('#count').val($(this).data('quantity') * $('#product_price').text()); }); });
fiddle here