原生方法获取select中选中的option

    1. :拿到select对象: `var myselect=document.getElementById("select");
       
    2. :拿到选中项的索引:var index=myselect.selectedIndex ; // selectedIndex代表的是你所选中项的index;
       
    3. :拿到选中项options的value: myselect.options[index].value;
       
    4. :拿到选中项options的text: myselect.options[index].text;
       
    5. :拿到选中项的其他值,比如这里的url: myselect.options[index].getAttribute('url');
原文地址:https://www.cnblogs.com/swt-axios/p/12855316.html