try{ var radio = document.createElement('<input type="radio" name="radio" />'); }catch(error){ var radio = document.createElement('input'); }