这是标题。它在新页面中给出结果,而我想在代码运行的同一页面中显示结果。请帮忙。
function calculate() {
var width = document.getElementById("width");
width1 = width.options[width.selectedIndex].text;
var height = document.getElementById("height");
var height1 = height.options[height.selectedIndex].text;
var calculate = width1 * height1 * 3;
result.innerHTML = "<div>" + calculate + "</div>";
}
身体
Choose Width
<select id="width" name="height" onchange="calculate()">
<option>1</option>
<option>1</option>
</select>
<br/>
Choose Heiht
<select id="height" name="height" onchange="calculate()">
<option>1</option>
<option>2</option>
</select>