我不确定你从哪里得到这个语法,但几乎一切都是错误的:
function increasenumber()
{
var value = parseInt(document.getElementById('number').innerText, 10);
value = isNaN(value) ? 0 : value;
value++;
document.getElementById('number').innerText = value;
}
<div id="number"></div>
<a onclick="increasenumber()" class="font1">random text here </a>