所以,正如标题所示;我试图弄清楚如何隐藏下拉列表。我正在使用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";