$('span').each(function() {
var text = $(this).text();
if($(this).text().indexOf("-") + 1 == 1) {
(this).addClass('price-fall');
};
});
$('span').text((i, text) => {
return ~'+-'.indexOf(text.charAt()) ? text : `+${text}`;
});
for (const n of document.getElementsByTagName('span')) {
n.innerText = '+'.slice('+-'.includes(n.innerText[0])) + n.innerText;
}
document.querySelectorAll('span').forEach(n => {
n.textContent = n.textContent.replace(/^(?![+-])/, '+');
});