I have converted some of my selects in my website to select2's and I notice that the following code no longer works. Assume I have in my html:
<select id = "CountryList" > </select>
Then
$("#CountryList").select2();
function Func() {
document.getElementById("CountryList").value = "";
}
Func();
What is the simplest way to fix this.
Edit: I am trying to set the selected value of the select to the empty string.
Edit 2: For anyone needing this as a function in the future I have added an answer