When I shrink the window and click the button it doesn't work. Button doesn't respond. What seems to be the problem here could anyone tell me please?
<button type="button"
class="navbar-toggle"
data-toggle="collapse"
data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li>
<a href="">Page 1</a>
</li>
<li>
<a href="">Page 2</a>
</li>
<li>
<a href="">Page 3</a>
</li>
</ul>
Libraries are jQuery 2.1.3 and bootstrap 3.3.1.
If you will change the ID then Toggle will not working same problem was with me i just change
id="defaultNavbar1" then toggle is working
Demo: http://jsfiddle.net/u1s62Lj8/1/
You need the jquery and boostrap javascript files included in your html page for the toggle to work.
Your code looks great, the only thing i see is that you did not include the collapsed class in your button selector. http://www.bootply.com/cpHugxg2f8 Note: Requires JavaScript plugin If JavaScript is disabled and the viewport is narrow enough that the navbar collapses, it will be impossible to expand the navbar and view the content within the .navbar-collapse.
The responsive navbar requires the collapse plugin to be included in your version of Bootstrap.
Remember load jquery before bootstrap js