I'm learning Bootstrap and jQuery. I'm very new to both of them.
I would like to generate the tag <select class="form-control">
dynamically through JavaScript code.
I have the following code in my JavaScript:
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');
From what I've read, the document.createElement("select")
creates the select tag dynamically.
My question is, how do I make that dynamically generated select tag using Bootstrap style (i.e. using class="form-control"
)?
I want the dropdown to be generated dynamically through jQuery/JavaScript (i.e., without using the select
tag in the HTML/JSP file.