Currently delving into the realms of Bootstrap and jQuery, these are both new territories for me.
I am looking to use JavaScript to dynamically create the
<select class="form-control">
tag.
In my JavaScript code snippet, I have this:
var response = originalRequest.responseXML;
var property = document.createElement("select");
property.id = "predicate(" + addprop.level + "," + addprop.count + ")";
property[property.length] = new Option("Properties", "");
var options = response.getElementsByTagName('option');
My understanding is that document.createElement("select")
allows for the dynamic creation of the select tag.
My query is how can I style this dynamically generated select tag using Bootstrap (specifically with class="form-control"
)?
The goal is to have the dropdown dynamically generated through jQuery/JavaScript without relying on the select
tag in the HTML/JSP file.