我有一个形式问题齿轮和设备的员工.在底部,我有一个按钮,应该使用SweetAlert2弹出一个协议消息.我已经在头部部分的脚本和CSS链接.它只是当我点击按钮,什么也没发生. Im新来这一点,并假设IM错过了一些重要的东西.
<div class="mt-2">
<button type="submit" class="btn btn-primary me-2" id="issueGear">Issue Gear</button>
<button type="reset" class="btn btn-outline-secondary">Cancel</button>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#issueGear').click(function(){
Swal.fire({
type: 'success',
title: 'Agreement',
text: 'I agree to return all issued items upon my voluntary or involuntary dismissal from
the department. If I fail to return any item(s), I may be help responsible for the
replacement cost of the item(s).'
})
})
}
</script>
字符串
1条答案
按热度按时间kgqe7b3p1#
“$(document).ready”中存在语法错误
字符串
然后将按钮类型更改为“按钮”
型