For some reason, creating switches like this in IE doesn't work.
A solution that seems to work (according to a found article here ):
var r; try { // This works in IE r = document.createElement('<input type="radio" name="foo1"/>'); } catch( err ) { // For everyone else r = document.createElement('input'); } r.setAttribute('type', 'radio'); r.setAttribute('name', 'foo1');
source share