function calculate(a) { alert("B"+a)}; calculate(''); calculate(2); calculate(3);
function calculate(a) { var inputA = document.getElementById("A"), selectB = document.getElementById("B"+a), inputC = document.getElementById("C"+a), A = parseFloat(inputA.value), B = parseFloat(selectB.value); inputC.value = (A * B).toFixed(2); } onclick="calculate(a);"