js获取select默认选中的Option并不是当前选中值_javascript技巧
来源:懂视网
责编:小采
时间:2020-11-27 21:22:45
js获取select默认选中的Option并不是当前选中值_javascript技巧
js获取select默认选中的Option并不是当前选中值_javascript技巧:js函数方法: 代码如下: function getDefaultSelectedOption(selectId, valIfNull) { var dom, selectId = selectId.replace(/^#/, ''), opts; try { opts = document.getElementById(selectId).g
导读js获取select默认选中的Option并不是当前选中值_javascript技巧:js函数方法: 代码如下: function getDefaultSelectedOption(selectId, valIfNull) { var dom, selectId = selectId.replace(/^#/, ''), opts; try { opts = document.getElementById(selectId).g

js函数方法:
代码如下:
js获取select默认选中的Option并不是当前选中值_javascript技巧
js获取select默认选中的Option并不是当前选中值_javascript技巧:js函数方法: 代码如下: function getDefaultSelectedOption(selectId, valIfNull) { var dom, selectId = selectId.replace(/^#/, ''), opts; try { opts = document.getElementById(selectId).g