rendered paste bodyfunction calcuulate(){
var gears = new Array(9);
var bestRatios = new Array(10);
var currentSpot = 0, tempRatio = 0.123, difference = 0.123,answerString = "", ans2string = "";
var tempThresh = document.getElementById('threshField').value;
if(isNaN(tempThresh) || tempThresh < 0){
threshold = 0;
document.getElementById('threshField').value = 0;
}else{ threshold = tempThresh }
for(i =0; i < 11; i++) {
bestRatios[i] = 9;
}
==================
function inc_or_dec(which) {
var value = new Number(document.getElementById('threshField').value);
if(isNaN(value) || value < 0){
value = 0;
}else if(value >= .05 && which == false){
value -= .05;
value = Math.round(value*100)/100;
}else if(which == true){
value += .05;
value = Math.round(value*100)/100;
}else{ value = 0 }
document.getElementById('threshField').value = value;
delete value;
}
======================
<input type="button" value="←" onclick="inc_or_dec(false)">
<input type="text" size ="5" id="threshField" value="threshold">
<input type="button" value="→" onclick="inc_or_dec(true)">
<input type="button" id="calcButton" value="Calculate" onclick="calcuulate()" disabled>