I wrote a javascript script that multiplies the values of 3 dropdown menus. However, I could only get it to print out the answer in a textbox. I want it to just print in text. When I use document.write or anything similar, it makes the whole page the value. Any suggestions? <script language="javascript" type="text/javascript"> function calcResult() { result.value = D1.options[D1.selectedIndex].value * D2.options[D2.selectedIndex].value * D3.options[D3.selectedIndex].value; } </script> <select class="txtbox" size="1" name="D1" onChange="calcResult()"> <option value="3">3</option> <option value="5">5</option> <option value="10">10</option> <option value="15">15</option> </select> <select class="txtbox" size="1" name="D2" onChange="calcResult()"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> <select class="txtbox" size="1" name="D3" onChange="calcResult()"> <option value="5">5</option> <option value="10">10</option> </select> Answer: <input type="text" name="result" size="20"> Code (markup):
******* JS document.getElementById('answer_place').innerHTML = D1.options[D1.selectedIndex].value * D2.options[D2.selectedIndex].value * D3.options[D3.selectedIndex].value; ******* HTML Answer: <span id='answer_place' name='answer_place'></span>