I would like
<span class="small">5 left</span>
// Store the 5 left in "numberStock" variable
var numberStock = parseInt($(".small:first").text());
// Subtract with "numberStock -1"
var minusStock = numberStock - 1;
// Here comes the issue, how do I add the new content?
i am not sure if i understood your question, but if i did here is a way to do it , which is pretty close to what you were trying to achieve
var numberStock = parseInt($('.small').text()) var minusStock = numberStock - 1; $('.small').text(minusStock + ' left');
here is a fiddle in case you want to test around with it https://jsfiddle.net/09wcjp7b/