$(function() {
$(".controlgroup").controlgroup();
$(".controlgroup-vertical").controlgroup({
"direction" : "vertical"
});
$("#banche").on("change", function() {
alert("prova");
});
});
HTML
<div id="primo" class="controlgroup">
<select id="banche">
<option></option>
<?php
if($_SERVER['REQUEST_METHOD']=='GET')
{
$con=new mysqli("localhost","root","","sist.bancario") or die("Errore durante la connessione");
$sql="select * from banche";
$rs=$con->query($sql) or die("Errore nella sintassi della query");
for($i=0;$i<$rs->num_rows;$i++)
{
$resrow= mysqli_fetch_row($rs);
echo "<option value=".$resrow[1].">$resrow[1]</option>";
}
$con->close();
}
?>
</select>
功能改变不起作用,我不知道为什么请帮帮我 我尝试了很多替代方案,但它们也不起作用
答案 0 :(得分:0)
将事件监听器绑定到正文:
$(body).on("change", "#banche", function(){
alert("prova");
});