I have a simple html block like:(我有一个简单的html块,如:)
<span id="replies">8</span>
Using jquery I'm trying to add a 1 to the value (8).(使用jquery我试图在值(8)中添加1。)
var currentValue = $("#replies").text();
var newValue = currentValue + 1;
$("replies").text(newValue);
What's happening is it is appearing like:(发生的事情是它出现如下:)
81(81)
then(然后)
811(811)
not 9, which would be the correct answer.(不是9,这将是正确的答案。)
What am I doing wrong?(我究竟做错了什么?)
ask by rball translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…