<body> <div class="product" rel="1"> <img class="img_t" src="http://24.img.avito.st/640x480/1406482124.jpg" alt=""> <span class="t_price">Телефон LG </span>цена: <span class="price">6200 </span>количество: <input type="text" size="1" value="0"> <span class="add_t"><img src="http://vstrezhah.ru/p/add.png" alt=""></span> <span class="del_t"><img src="http://www.stitch.su/images/delete_label.gif" alt=""></span> <br> </div> <br> <div class="product" rel="1"> <img class="img_t" src="http://24.img.avito.st/640x480/1406482124.jpg" alt=""> <span class="t_price">Телефон LG </span>цена: <span class="price">6200 </span>количество: <input type="text" size="1" value="0"> <span class="add_t"><img src="http://vstrezhah.ru/p/add.png" alt=""></span> <span class="del_t"><img src="http://www.stitch.su/images/delete_label.gif" alt=""></span> <br> </div> <span id="totalItem"> Итого: <span>0</span> </span> </body> And there is jQuery :
$(document).ready(function(){ var count = 0; $('.add_t').click(function(){ $('input[type=text]').attr('value', count++); }); }); The bottom line is that when you click on the plus sign, the number is displayed in the input field in the value value .
I know that this is done using this , but I do not know how, tell me, please.
UPD
http://jsfiddle.net/2kygh3ba/7/
If this is correct, then how can I transfer this to a php processor?