I successfully created a JavaScript function to add an input file tag and a link, but now I would like to include a radio button along with some text next to it. I have been able to add the radio button without any issues, but I'm unsure how to insert the accompanying text.
Here is the existing code...
addCampo = function () {
nDiv = document.createElement('div');
nDiv.className = 'archivo';
nDiv.id = 'file' + (++numero);
nCampo = document.createElement('input');
nCampo.name = 'archivos[]';
nCampo.type = 'file';
a = document.createElement('a');
a.name = nDiv.id;
a.href = '#';
a.onclick = elimCamp;
a.innerHTML = ' Eliminar';
portada = document.createElement('input');
portada.name = 'portada';
portada.type = 'radio';
portada.value = '1';
nDiv.appendChild(nCampo);
nDiv.appendChild(portada);
// HERE I WANT A SIMPLE TEXT SAYING WHAT DOES THE RADIO BUTTON INDICATE
nDiv.appendChild(a);
container = document.getElementById('adjuntos');
container.appendChild(nDiv);
}
The code works perfectly fine as it is! The only dilemma I face is regarding including plain text without tags...