| 83 | } else if (elem.className == 'radiolist') { |
| 84 | var cnt = elem.getElementsByTagName('li').length; |
| 85 | var idName = elem.id+'_'+cnt; |
| 86 | var newLi = document.createElement('li'); |
| 87 | var newLabel = document.createElement('label'); |
| 88 | var newText = document.createTextNode(' '+newRepr); |
| 89 | try { |
| 90 | // IE doesn't support settings name and type by setAttribute |
| 91 | var newInput = document.createElement('<input type=\'radio\' name=\''+name.slice(3)+'\' checked=\'checked\' />'); |
| 92 | } catch (err) { |
| 93 | var newInput = document.createElement('input'); |
| 94 | } |
| 95 | newLabel.setAttribute('for', idName); |
| 96 | newInput.setAttribute('id', idName); |
| 97 | newInput.setAttribute('class', 'radiolist'); |
| 98 | newInput.setAttribute('type', 'radio'); |
| 99 | newInput.setAttribute('name', name.slice(3)); |
| 100 | newInput.setAttribute('value', newId); |
| 101 | newInput.setAttribute('checked', 'checked'); |
| 102 | newLabel.appendChild(newInput); |
| 103 | newLabel.appendChild(newText); |
| 104 | newLi.appendChild(newLabel); |
| 105 | elem.appendChild(newLi); |