Retrieve an item from the dropdown list and insert it into a button's value.
function updateButton() {
document.getElementById("ul").classList.toggle("show");
}
var dropdown = document.getElementById('ul');
var items = ["HTML", "CSS", "JavaScript", "jQuery", "AngularJS"];
for (var i = 0; i < items.length; i++) {
var listItem = document.createElement("li");
var link = document.createElement("a");
link.setAttribute('href', '#');
listItem.appendChild(link);
var textNode = document.createTextNode(items[i]);
link.appendChild(textNode);
dropdown.insertBefore(listItem, dropdown.childNodes[i]);
}