jQuery is working fine without linking bootstrap, but if i add bootstrap it goes all wrong basically i'm trying to build simple FAQ. If somebody can help me? here is the html file.
<html>
<head>
<meta charset=utf-8>
<title></title>
<link rel="stylesheet" href="css/bootstrap.css"> //works fine without this
<link rel="stylesheet" href="style.css" type="text/css">
<script src="jquery-2.2.3.js"></script>
<script src="js/bootstrap.js"></script>
</head>
<body>
<dl>
<dt>title</dt>
<dd>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer quis porttitor erat.</dd>
<dt>title</dt>
<dd>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer quis porttitor erat.</dd>
</dl>
</body>
</html>
jQuery/script:
(function() {
var dd = $('dd');
dd.filter(':nth-child(n+2)').addClass('hide');
$('dl').on('click', 'dt', function() {
$(this)
.next()
.slideDown(200)
.siblings('dd')
.slideUp(200);
});
})();
css goes this way
body {
width: auto;
margin: 20px;
}
dd {
margin: 0;
padding: 1em 0;
}
dt {
cursor: pointer;
font-weight: bold;
font-size : 1.5em;
line-height: 2em;
background: #e3e3e3;
border-bottom: 1px solid #c5c5c5;
border-top: 1px solid white;
}
dt:first-child { border-top: none; }
dt:nth-last-child(2) { border-bottom: none; }
.hide { display: none;}