<select name="goodStyles" id="goodStyles"onChange="showstore(this.value);">
<option value="" selected>
产品种类
</option>
<c:forEach var="goodStype" items="${goodStypeList}">
<option value="${goodStype.typeid }">${goodStype.typename }</option> </c:forEach>
</select>
[align=left]function showstore(store){
var store = document.getElementById(store);
var goodstore = document.getElementById("goodstore");
if(store!=null){
goodstore.value =getValue(store) ;
}
}[/align]

解决方案 »

  1.   


    没有value 属性onChange="alert(this.value);" 测试一下
      

  2.   

    这个value就是change事件当前选择的option的value
      

  3.   

    就是你选择的option的value值<select name="goodStyles" id="goodStyles"onChange="alert(this.value);">
    <option value="111" selected>
    产品种类
    </option>
    <option value="222" selected>
    产品种类
    </option>
    <option value="333" >
    产品种类
    </option></select> 
      

  4.   

    this.value代表你所选中的值,例如javascript中的:document.getElementById("goodstore"); 
    this指的是:select这个标签对象,
    根据this.value值,onChange="showstore(this.value)"
    来判读你选中的是那个选项
      

  5.   

    this表示引起事件的对象,也就是那个SELECT对象,value就是onchange事件发生时你选中的那个项的值
      

  6.   

    选中项的值,this指向该select表单
      

  7.   

    那 那个 js方法中var store = document.getElementById(store); 得到的又是什么呢,getElementById不是根据标签的id号来得到dom吗,这怎么解释呢?
      

  8.   

    document.getElementById(store)获得store节点对象。document内查找"showstore(this.value);"
    this本身就是store节点