Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <button href="#" data-dropdown="drop1" aria-controls="drop1" aria-expanded="false" class="button dropdown">Order list by: </button><br>
- <ul id="drop1" data-dropdown-content class="f-dropdown" aria-hidden="true">
- <li><a href="#">This is a link</a></li>
- <li><a href="#">This is another</a></li>
- <li><a href="#">Yet another</a></li>
- </ul>
- $('li').on('click', function(){
- $('button span').text($(this).text());
- });
- <button href="#" data-dropdown="drop1" aria-controls="drop1" aria-expanded="false" class="button dropdown">Order list by: <span id="orderBy"></div></button><br>
- $("li a").on("click", function() {
- $("button #orderBy").text($(this).text());
- });
Add Comment
Please, Sign In to add comment