According to the Pure.css documentation, a dropdown menu should appear when I click on Option3
, but it doesn't. Why is it?
.custom-restricted-width {
width: 150px;
}
<link href="https://unpkg.com/[email protected]/build/pure-min.css" rel="stylesheet" />
<div id="menu">
<div class="pure-menu custom-restricted-width">
<a class="pure-menu-heading" href="index.html">Title</a>
<ul class="pure-menu-list">
<li class="pure-menu-item"><a href="#" class="pure-menu-link">Mune item 1</a>
</li>
<li class="pure-menu-item pure-menu-has-children">
<a href="#" id="menuLink1" class="pure-menu-link">Menu item 2</a>
<ul class="pure-menu-children">
<li class="pure-menu-item"><a href="#" class="pure-menu-link">Submenu item 1</a>
</li>
<li class="pure-menu-item"><a href="#" class="pure-menu-link">Submenu item 2</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
I've found the solution after reading the document again:
So if you download the example script above and include it with
<script src="js/dropdown.js"></script>
or something alike, the dropdown menu would work as expected.