【发布时间】:2017-12-15 14:04:40
【问题描述】:
我写了一些代码,它使用 PHP 生成一个表单。我想使用 javascript(第 57 行)进行更多更改 - 通过从下拉菜单中选择一些内容(第 127 行):
如果我选择值“范围”,我想在表单中再生成两个输入, 就在该行的旁边。
This is how I want it to look like
// Javascript
$(function() {
$("#select1").on("change",function() {
var value = this.value;
document.getElementById('a').innerHTML = value;
});
});
// HTML
<select onchange="select(this.value)" id="select1" name="type$i" size="1">
<option value="max">Maximum the best</option>
<option value="min">Minimum the best</option>
<option value="range">Range</option>
</select>
【问题讨论】:
-
(57 line)和(127 line)是什么意思..? -
听起来不太复杂,测试
if(this.value==="range") displayTheTwoInputs()之类的吧
标签: javascript php jquery select onchange