Javascript 选择日期时如何弹出模式
我试图弹出一个模式,当我点击一个特定的日期。 我的密码是这个。当我选择一个约会的时候,什么都没有发生,我也不知道为什么Javascript 选择日期时如何弹出模式,javascript,jquery,date,Javascript,Jquery,Date,我试图弹出一个模式,当我点击一个特定的日期。 我的密码是这个。当我选择一个约会的时候,什么都没有发生,我也不知道为什么 <input type="date" id="startdate1"name="startdate1"required> <div class="modal fade" id="fileUploadModal" role="dialog"
<input type="date" id="startdate1"name="startdate1"required>
<div class="modal fade" id="fileUploadModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Add Comment</h4>
</div>
<div class="modal-body">
<p><textarea id = "commentsUpload"class="form-control custom-control" rows="3" style="resize:none"></textarea></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" onclick="submitXYX()" data-dismiss="modal">Submit</button>
</div>
</div>
</div>
</div>
<script >
$( document ).ready(function() {
$( "#startdate1" ).change(function() {
$('#fileUploadModal').modal('show')
});
});
</script>
&时代;
添加注释
提交
$(文档).ready(函数(){
$(“#开始日期1”).change(函数(){
$('#fileUploadModal').modal('show')
});
});
你的代码运行得很好,你添加的boostrap js和css正确吗?jquery之后?@CarstenLøvboAndersen你看到的是我写的东西,我不知道问题出在哪里。是的,我可以看到你写的东西,请告诉我你在哪里添加了bootstrap和jquery,以及它们的顺序。这里的演示非常感谢我包括了错误的src,这不起作用,我使用了你提供给我的那个,它工作得很好,再次非常感谢!