Created a dropDown for classification

Hi Ines,

I created a dropDown List using this js code:

function createList(list){

		var dList = document.createElement('select');
		dList.setAttribute("class","js-example-basic-single");

		list.forEach(item =>{
			var dOption = document.createElement('option');
			dOption.setAttribute('value',item);
			dOption.setAttribute('text', item);
			dOption.innerText = item;
			dList.appendChild(dOption);
		})
		return dList
	}

l = ["one", "two", "THREE"];
var list = createList(l)
var container = document.getElementsByClassName('container')[0];
container.appendChild(list)

Everything worked fine! I tried to add a search bar to this dropDown List and nothing happened. This is what I added to the head of my page in order to do that.

<link href="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/css/select2.min.css" rel="stylesheet" />
	<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
	<script src="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/js/select2.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
		    $('.js-example-basic-single').select2();
		});
	</script>

My broser does not show any errors. Am I doing it wrong ?

Hi! I'm not sure I can help with this, as it comes down to arbitrary specifics of jQuery and the jQuery plugin you're using. Are you sure the tags are present in the <head> and executed? You might want to use JS to add them and use the prodigymount listener to make sure Prodigy is ready before you try to access HTML content in the annotation cards.

Maybe this is also a bit overkill and a simpler <datalist> would be better for this use case?