<div id="myDiv">
<input type="button" value="-">
<input type="text" id="inp" size="1" value="1" disabled>
<input type="button" value="+"><br>
<input type="button" value="-">
<input type="text" id="inp" size="1" value="1" disabled>
<input type="button" value="+"><br>
<input type="button" value="-">
<input type="text" id="inp" size="1" value="1" disabled>
<input type="button" value="+"><br>
</div>
<script>
window.onload = function () {
var myDiv = document.getElementById('myDiv');
var inp;
myDiv.onclick = function (e) {//onclick begin
e = e || event
var target = e.target || e.srcElement;
if (target.value == '+') {
inp = target.previousSibling.previousSibling;//previousElementSibling лучше, но не для IE<9
if (parseInt(inp.value) < 5) {
inp.value = parseInt(inp.value) + 1;
}
} else if (target.value == '-') {
inp = target.nextSibling.nextSibling;//nextElementSibling лучше, но не для IE<9
if (parseInt(inp.value) > 1) {
inp.value = parseInt(inp.value) - 1;
}
}
}//onclick end
}
</script>