JQuery使用trigger模拟触发selete的选择change事件

<!DOCTYPE HTML>
<html lang="en-US">
<head>
    <meta charset="UTF-8">
    <title>easonjim</title>
    <script src="scripts/jquery.js" type="text/javascript"></script>
</head>
<body>
<select id='province'>
    <option value='6'>66
    <option value='7'>77
    <option value='8'>88
</select>
<input type='button' id="btn1" value='setPi'>
<script type="text/javascript">
    $('#province').on("change", function () {
        alert($('#province').get(0).selectedIndex);
    });
    $('#btn1').on("click", function () {
        $('#province').get(0).selectedIndex = 1;
        $('#province').trigger("change");
    });
</script>
</body>
</html>
原文地址:https://www.cnblogs.com/EasonJim/p/8291858.html