这是我的代码,但我无法获取在 selectpicker 引导程序中选择的值。知道怎么做吗?
<select class="selectpicker form-group show-tick" id ="department" data-live-search="true" data-width="100%" multiple title = "Select Restaurant/Store - ID" data-max-options="1">
<?php
while ($rstorefrom = mysqli_fetch_array($resultstorefrom))
{
echo "<option value = " .$rstorefrom['department']. "data-tokens=" .$rstorefrom['department'].">" .$rstorefrom['department']. "</option>";
echo "<script>
$('#department').on('click',function() {
alert($(this).val());
console.log($(this).val());
</script>";
}
?>
</select>