var n=parseInt(this.previousElementSibling.value,10); this.previousElementSibling.value=++n;
<input> <span onclick="var el=this.previousElementSibling; el.value=+el.value+1;">span</span>