Can someone explain me why this code below does not hit the on change function?
HTML
<div class="form-group">
@Html.DropDownList("Relatorios", ViewBag.Tipos as SelectList, new { id = "Relatorios"})
</div>
Script
$(document).ready(function () {
$("#Relatorios").on("change", function () {
alert("Success");
});
});
I expected that function to hit when I change de option in the drop down list
I resolved the problem with the code below
$(window).load(function () {
$("#Relatorios").on("change", function () {
settabledata();
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.