options selected
jeg kan ikke få den escapede linje til at virke.. når jeg undescaper bliver min select slet ikke lavetselect_obj.options[select_obj.options.length] = new Option(option_obj[key], key);
//select_obj.options[select_obj.options.length].selected = (value == option_obj[key]) ? true:false;
hele koden:
function append_select(obj, int, option_obj)
{
var value = obj[int].getElementsByTagName('span')[0].innerHTML;
var select_obj = document.createElement('select');
for(var key in option_obj)
{
select_obj.options[select_obj.options.length] = new Option(option_obj[key], key);
select_obj.options[select_obj.options.length].selected = (value == option_obj[key]) ? true:false;
}
obj[int].removeChild(obj[int].getElementsByTagName('span')[0]);
obj[int].appendChild(select_obj);
}