yok2xDuran yok2xDuran - 11 days ago 4
CSS Question

Bootstrap w3school tutorial Dropdown not work

Hi I'm new with bootstrap and I'm trying to create the dropdown bootstrap and its not working.

Here is my HTML

<!DOCTYPE html>
<html>
<head>
<title>Sample</title>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<link rel="stylesheet" href="css/bootstrap.min.css">
</head>
<body>
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" id="ddButton" data-toggle="dropdown">Button</button>
<ul class="dropdown-menu" role="menu">
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
<li><a href="#">JavaScript</a></li>
</ul>
</div>
</body>
</html>


I'm using w3school.com as reference.

Answer

From the console:

bootstrap.min.js:6 Uncaught Error: Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4

Update jQuery

3.x snippet:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>

2.x snippet:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>

1.x snippet:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
Comments