Hi everyone!
I'm using the DOM standard to create a set of radio buttons, but I can't select any of them. It means that they appear in the page, but when I click on any of them nothing seems to happen. This is the code I've written to create the radio buttons
var list = document.create Element("table" );
var tbody = document.create Element("tbody" );
var values = new Array("Hoy","Ay er","Ultima semana","Este mes","Personali zar");
for(var i=0; i<values.length ; i++)
{
var tr = document.create Element("tr");
var td = document.create Element("td");
td.setAttribute ("align","left" );
var option = document.create Element("input" );
option.setAttri bute("type","ra dio");
option.setAttri bute("name","da te");
option.setAttri bute("value",va lues[i]);
td.appendChild( option);
td.appendChild( document.create TextNode(values[i]));
tr.appendChild( td);
tbody.appendChi ld(tr);
}
list.appendChil d(tbody);
return list;
So if any of you sees that something is missing, say an attribute or something like that to make it work, please help me out and reply this.
Thanks a lot
Kenia
I'm using the DOM standard to create a set of radio buttons, but I can't select any of them. It means that they appear in the page, but when I click on any of them nothing seems to happen. This is the code I've written to create the radio buttons
var list = document.create Element("table" );
var tbody = document.create Element("tbody" );
var values = new Array("Hoy","Ay er","Ultima semana","Este mes","Personali zar");
for(var i=0; i<values.length ; i++)
{
var tr = document.create Element("tr");
var td = document.create Element("td");
td.setAttribute ("align","left" );
var option = document.create Element("input" );
option.setAttri bute("type","ra dio");
option.setAttri bute("name","da te");
option.setAttri bute("value",va lues[i]);
td.appendChild( option);
td.appendChild( document.create TextNode(values[i]));
tr.appendChild( td);
tbody.appendChi ld(tr);
}
list.appendChil d(tbody);
return list;
So if any of you sees that something is missing, say an attribute or something like that to make it work, please help me out and reply this.
Thanks a lot
Kenia
Comment