bond1211,
непроставили значение value изначально ?
вариант без установки value
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script>
$(document).ready(function () {
$('.plus_minus_icon').on("click", function () {
var $sum = $('#product_buy_quantity'),
Value = parseFloat($sum.val())||0;
if ($(this).hasClass("plus")) {
Value += 5
} else {
if (Value > 1) {
Value -= 5
}
}
$sum.val(Value);
$sum.change();
});
$('#product_buy_quantity').on("change input", function () {
var main_price = Number($('#formated_price').data('price'));
var input_quantity = Number($('#product_buy_quantity').val());
main_price *= input_quantity;
$('#formated_price').text(main_price) });
$('#product_buy_quantity').change()
});
</script>
</head>
<body>
<div class="plus_minus_icon plus"><img src="http://javascript.ru/forum/images/smilies/victory.gif" alt=""/></div>
<input type="text" class="num" name="quantity" id="product_buy_quantity" size="2" value="" />
<div class="plus_minus_icon minus"><img src="http://javascript.ru/forum/images/smilies/nono.gif" alt=""/></div>
<div id="formated_price" data-price="100"></div>
</body>
</html>