You will need to get all the values from the data list, and then create a new HTML line to add to the DOM.
You also need to remove the datalist before adding a new selection, as they will have the same identifier.
As you add, the choice will depend on the structure of your HTML; I used append to add it as a fist child, although you may need to do something else.
EDIT tag added as first option
$(function() { var list = $('#list'), label = list.find('dt').text(), parent = list.parent(), anchors = list.find('a'), html = '<select id="list"><option selected value="">' + list.find('dt').text() + '</option>' ; for(var i=0; i<anchors.length; i++) { //each anchor becomes an option in the select html += '<option value="' + anchors.eq(i).attr('href') + '">' + anchors.eq(i).text() + '</option>'; } html += '</select>'; list.remove(); //remove your datalist parent.append(html); //add your new select });
JsFiddle work
source share