When I click the button in my HTML and JavaScript code below, I am able to dynamically add a text field and radio button. This functionality is working properly. However, I also want the newly generated text field to have the same font size and appearance as the one above it, meaning I want it to inherit the same class.
Here is the HTML:
<input type="radio" name="choices" value="o1"/>
<input type="text" name="o1" id="o1" class="inputtype"/>
<span class="file-wrapper">
<input type="file" name="o1_i" />
<span class="button">Choose a file</span>
</span>
<div id="responce"></div>
And here is the JavaScript:
var div = document.getElementById("responce");
var radio = document.createElement("input");
radio.type = "radio";
radio.name = "choices";
radio.value = "o" + countBox;
div.appendChild(radio);
var text = document.createElement("input");
text.type = "text";
text.id = "o" + countBox;
text.name ="o" + countBox;
div.appendChild(text);
var upload = document.createElement("input")
upload.type = "file";
upload.name= "o" + countBox + "_i";
div.appendChild(upload);