Good day to all. Asked to see the code in which there is one problem. In jQuery, I'm not really. There is a site, on it you carry out tasks, points are given for tasks. There are two divas with the same class .balance_num, in which points are displayed, after completing, a certain amount is added to these points, and the total amount is not displayed correctly in total.
_balance: funtion(n) { var points_a = $('.balance_num').text() * 1 //берется изначальное количество баллов var points_plus = points_a + (n * 1); //прибавляется баллы за задание $('.balance_num').text(points_plus); //вставляется обратно в оба div } It seems simple. But for example, if there were 12 points, for the task they added 3 points, and instead of 15 points, for some reason he inserts the number 1215.
Tell me where to dig?