更新时间:2022-06-12 06:22:15
option改为value。
First of all you should change "id" on your "option" to "value".
然后,您可以使用:
$(function () {
$("#graph_select").change(function() {
var val = $(this).val();
if(val === "pilot_graph_form") {
$("#pilot_graph_form").show();
$("#client_graph_form").hide():
}
else if(val === "client_form") {
$("#client_graph_form").show();
$("#pilot_graph_form").hide();
}
});
});