gpt4 book ai didi

html - 可解除警报

转载 作者:行者123 更新时间:2023-12-04 01:46:23 25 4
gpt4 key购买 nike

我试图在单击“x”按钮时让警报消失,但似乎缺少某些东西使其无法正常工作,我不确定它是什么。

<div class="alert alert-success alert-dismissible">
<button type = "button" class="close" data-dismiss = "alert">x</button>
You've done it!
</div>

最佳答案

要使 dismissible 正常工作,您需要在文档中包含 jQuerybootstrap.js

 <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
<div class="alert alert-success alert-dismissible">
<button type = "button" class="close" data-dismiss = "alert">x</button>
You've done it!
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<div style="margin-top: 50px" class="alert alert-success alert-dismissible">
<button type = "button" class="close" data-dismiss = "alert">x</button>
You've done it!
</div>

关于html - 可解除警报,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43308367/

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