I'm working on creating a pair of radio buttons in my JavaScript for a web application. Here's the code I have so far:
//radio buttons start
var AddRadio = function(options){
var _dom_element = document.createElement("radio");
for (var i = 0; i < options.length; i++) {
var _option = document.createElement("radio");
_option.value = options[i];
_option.innerHTML = options[i];
_dom_element.appendChild(_option);
};
this.getDomElement = function() {
return _dom_element;
}
}
//radio buttons end
var _temp_radio = new AddRadio(['Max Temp', 'Min Temp']);
container_element.appendChild(_temp_radio.getDomElement());
The issue I'm facing is that only the text 'Max Temp' and 'Min Temp' are visible, but the actual radio buttons themselves do not appear. Would greatly appreciate any help or suggestions!