由于某种原因,这不起作用,任何帮助都值得赞赏。
<script>
$(document).ready(function(){
$('select[name=materialSelect]').change(function(){
alert("Changed");
});
});
</script>
<select name="materialSelect" id="materialSelect">
<option value="-1">-----Select Material-----</option>
<option value="0">Material</option>
</select>
最佳答案
您的代码没有任何问题,请注意您已调用
$('select[name=materialSelect]').change(function(){
alert("Changed");
});
之后您的 html 就会被加载。
对于示例,将文档加载到调用您的代码的函数。
关于javascript - Jquery.change(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37552222/