Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hy, how we create ul/li dropdown button. dropdown list has county names.

What I have tried:

I have tried so many times but I have an issue with jquery libraries.
Posted
Updated 15-Mar-18 0:14am
Comments
Sarita Mall 23-Feb-18 1:45am    
could you please share your code ,so that can check the exact issue.

1 solution

var html = "<ul>" +
           "<li>First list item</li>" +
           "<li>Second list item </li> +
           "</ul>";

$("#elementWhereYouWantToLoadThisHTML").html(html);


This will load the ul/li.
To make the ul,li a dropdown, you can use bootstrap classes like below from [^] :

<div class="dropdown">
  <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Dropdown Example
  <span class="caret"></span></button>
  <ul class="dropdown-menu">
    <li><a href="#">HTML</a></li>
    <li><a href="#">CSS</a></li>
    <li><a href="#">JavaScript</a></li>
  </ul>
</div>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900