gpt4 book ai didi

javascript - jQuery 提交不起作用?

转载 作者:行者123 更新时间:2023-11-28 12:33:47 25 4
gpt4 key购买 nike

我使用了 Bootstrap 的模式,当我单击添加更改按钮时,没有任何反应..:(

头部脚本:

<script>
$("addBtn").click(function() {
$("programFormDropDown").submit(function(event) {
});
});
</script>

我的正文模态:

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">Confirm your change</h4>
</div>
<div class="modal-body">Are you sure you need to add these ?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button id="addBtn" class="btn btn-primary">Add changes</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

和我的 body 在同一个 body

<form id="programFormDropDown" action="../hDashBoard/project">

......

你能提供一些想法吗?

最佳答案

您似乎忘记了选择器中的 #除非您使用 Mootools,它通过 $('id') 获取 ID > 试试这个:

$("#addBtn").click(function() {
^
$("#programFormDropDown").submit(function(event) {
^
});
});

关于javascript - jQuery 提交不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19311590/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com