<head>
<script src="jQuery.js"></script>
<script src="bootstrap.js"></script>
<link rel="stylesheet" href="bootstrap.css">
<title>Bootsrap</title>
<meta charset="UTF-8">
</head>
<button data-toggle="collaspe" data- target="#demo">Collapsible</button>
<div id="demo" class="collapse">
some will say that the way to go about doing some of the real things is by
doing it by the book to avoid some of the boring things that are said in the
latter age of the new and humble heritage of the monk of the new age.
</div>
我实际上将bootstrap css和js导入到我的html加jquery的同名文件夹中。
答案 0 :(得分:2)
错字。将data-toggle="collaspe"
更改为data-toggle="collapse"
,并确保<button>
为type="button"
<button type="button" data-toggle="collapse" data-target="#demo">Collapsible</button>
<div id="demo" class="collapse">
some will say that the way to go about doing some of the real things is by
doing it by the book to avoid some of the boring things that are said in the
latter age of the new and humble heritage of the monk of the new age.
</div>
<强> Bootply 强>
答案 1 :(得分:0)
你是否在bootstrap js之前包含了jquery js?
在您的浏览器控制台(开发人员工具)中,您是否可以看到这些文件包含正确?