JQuery Mobile Hide下拉列表

时间:2016-08-01 15:04:01

标签: javascript jquery html css

所以,正如标题所示;我试图弄清楚如何隐藏下拉列表。我正在使用JQuery移动功能。当我试图隐藏它时,它仍然可见。

这是我的下拉代码:

<select name="areaName" id="areaName" data-inline="true">
                    <option value="0">Select an Area</option>
                    <?php
                        include ("partials/connectDb.php");

                        $goverChoice = $_POST['goverName'];

                        $query = "SELECT * FROM area_table WHERE governorate = '$goverChoice';";
                        $run_query = mysqli_query($conn, $query);

                        while ($row = mysqli_fetch_array($run_query))
                        {
                            # code...
                            $aId = $row['a_id'];
                            $aName = $row['name'];
                            echo "<option value='{$aId}'>{$aName}</option>";
                        }
                    ?>
</select>

这是我的JS代码:

document.getElementById("areaName").style.display = "none";

0 个答案:

没有答案