美文网首页
下拉框onchange方法时传递选中的option的value

下拉框onchange方法时传递选中的option的value

作者: 前端后台都不精 | 来源:发表于2019-08-19 18:34 被阅读0次
    <!-- html -->
    <select onchange="changeSelect(this.options[this.options.selectedIndex].value)">
    </select>
    <!-- Js -->
    function changeSelect(value){
    console.log(value);
    }
    

    相关文章

      网友评论

          本文标题:下拉框onchange方法时传递选中的option的value

          本文链接:https://www.haomeiwen.com/subject/cnvesctx.html