这段代码,点击按钮后,永远都是undefined!!!!
<p style="text-align:center">
<select id='selectId' name="selectName" style="width:100;text-align:center">
<option value="0">baidu</option>
<option value="1">google</option>
<option value="2">bing</option>
</select>
<input type="text" id='inputId' name='inputName' style="width:600"></input><button style="width:100" onclick="search()">Search</button>
</p>
<script type="text/javascript">
<!--
function search(){
var ss = document.getElementById("inputId").Value;alert(ss);
}
//-->
</script>
已经改了一遍又一遍,没脾气了……
------解决方案--------------------是大写吗?
------解决方案--------------------var ss = document.getElementById("inputId").value;
value小写
------解决方案--------------------<p style="text-align:center">
<select id='selectId' name="selectName" style="width:100;text-align:center">
<option value="0">baidu</option>
<option value="1">google</option>
<option value="2">bing</option>
</select>
<input type="text" id='inputId' name='inputName' style="width:600"></input><button style="width:100" onclick="search()">Search</button>
</p>
<script type="text/javascript">
<!--
function search(){
var ss = document.getElementById("inputId").value;alert(ss);
}
//-->
</script>
代码写的不对