如何在jquery wordpress中获取下拉值onchange

时间:2016-06-16 09:33:00

标签: jquery wordpress

关于更改提醒的我的观看页面我没有

<table width="100%">
            <tbody>
                <tr class="form-field form-required">
                    <th scope="row"><label for="Country">Country</label></th>
                    <td><select name="country_id" id="country_id" onchange="country_change();" class="form-control" aria-required="true" ><option value="" >Select</option>
                    <?php foreach ($country_list as $obj) { 
                    echo "<option value=".$obj->id.">".$obj->country."</option>";  } ?></select></td>
                </tr>
                <tr class="form-field form-required">
                    <th scope="row"><label for="state">State</label></th>
                    <td><select name="state_id" id="state_id" class="form-control" aria-required="true" ><option value="" >Select</option>
                    <?php //foreach ($country_list as $obj) { 
                    //echo "<option value=".$obj->id.">".$obj->country."</option>";  } ?></select></td>
                </tr>
                <tr class="form-field form-required">
                    <th scope="row"><label for="city">City</label></th>
                    <td><input name="city" type="text" id="city" value="" aria-required="true" autocapitalize="none" autocorrect="off" maxlength="60"></td>
                </tr>
            </tbody>
        </table>

我的剧本

<script type="text/javascript">
    function country_change() {
        alert('abdul');
            var country_id = $('#country_id').val();
            alert(country_id);

    }
</script>

我是** WordPress的新手。我只收到一个警报。第二个警报我没有得到**

0 个答案:

没有答案