I can't make bootstrap dropdown to work. Here is my html for nav:
<ul class='nav'>
<li class='active'>Home</li>
<li class='dropdown'>
<a class="dropdown-toggle" data-toggle="dropdown" href='#'>Personal asset loans</a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">asds</a></li>
<li class="divider"></li>
</ul>
</li>
<li>Payday loans</li>
<li>About</li>
<li>Contact</li>
</ul>
And here are the scripts:
<script type="text/javascript" src="js/bootstrap/bootstrap-dropdown.js"></script>
<script>
$(document).ready(function(){
$('.dropdown-toggle').dropdown()
});
</script>
What am I doing wrong? Thanks for your answers!
Add following lines within the body tags.
Try this in the head section
I had the same issue which brought me here.
My Issue : I was using the recommended jquery 1.12.0 version as my jquery script file.
Solution : replaced the jquery script with jquery 2.2.0 version.
That solved it for me.
FYI: If you have bootstrap.js, you should not add bootstrap-dropdown.js.
I'm unsure of the result with bootstrap.min.js.
you have to import this files into the
<head></head>
of your html.Both bootstrap and jquery must be included:
NOTE: jquery-x.x.x.min.js version must be version 2.x.x !!!