I'm currently working on a project and I require the ID of the label in order to store it and display it within a modal that will be shown to the user. How can I retrieve the ID instead of the name that is enclosed within the tags?
window.saveAndDisplay = function() {
var result = document.getElementById('demo');
var list = document.getElementById('dropBox');
while (list.children.length > 0) {
result.appendChild(list.children[0]);
}
}