Im having trouble with this code. I have tried two versions, the first does nothing and the second works but it adds a listbox and not a dropdown menu. Im not sure what the deal is but I just want to add a dropdown menu dynamically when I click a button or link, I have that part coded, Im just having trouble getting the element right. Im using FF 7.01, but I would like to come up with something that is browser neutral.
Please help. Thanks.
1.
var cellRight = row.insertCell(2);
var ella = document.createElement('option');
ella.type = 'select';
ella.size = 2;
cellRight.appendChild(ella);
2.
var cellRight = row.insertCell(2);
var ella = document.createElement('select');
ella.type = 'select';
ella.size = 2;
cellRight.appendChild(ella);
the size attribute specifies the number of visible options in a drop-down list.
if you give two then it will create a ListBox ,as we can have only one option visible for a dropdown , but you are specifying size=2 , so its creating ListBox
Bookmarks