I had an earlier question last month on dropdown issue and "F-ES SiteScore" username helped me achieve that.
<button >Click me</button>
<script>
function myFunction() {
// append the whole html for a select
document.getElementById("demo").innerHTML += "<select><option value='1'>One</option></select>";
// or create one programatically and add it to the DOM
var select = document.createElement("select");
var option = document.createElement("option");
option.value = "1";
option.text = "One";
select.appendChild(option);
document.getElementById("demob").appendChild(select);
return false;
}
</script>
But, I need help including the following... in-place of appendchild option..
open bracket cfselect
name="NameList" size="1" query="UserRole_q" value="EmpID" display="Name" selected="#temp#">
<option value="-1"></option>
close cfselect bracket