jquery获取select标签的选中元素

select 标签配合 option 使用,是很好的下拉菜单,获取选中的选项值,可以用 jquery 的 api 简单直接的获取:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
    </head>
    <body>
        <select id='selection' onclick="clickClick()">
            <option>1</option>
            <option>2</option>
            <option>3</option>
            <option>4</option>
            <option>5</option>
        </select>
        <script src='jquery-1.11.3.js'></script>
        <script>
            function clickClick(){
                console.log($('#selection').find('option:selected').text());
            }
        </script>
    </body>
</html>
原文地址:https://www.cnblogs.com/guofan/p/6773281.html