1
가능한 중복 :
Javascript doesn't work in IE8document.createElement 던지는 오류 IE 8에이 명령이 지원되지 않는 오류
I 후 다음 코드
var ind=1;
try
{
rdo = document.createElement('<input type="radio" name="radioOptions" />');
}
catch(err)
{
rdo = document.createElement('input');
}
rdo.setAttribute('type','radio');// error
rdo.setAttribute('name','radioOptions');
rdo.id = 'radioOption_'+ind;
rdo.value = ind;
에게 있습니다 철저한 점검이 줄은 IE 8에서 오류를 던지고있다
rdo.setAttribute('type','radio')
이상한 사실은 그것이 로컬 시스템에있을 때 그 일을하지 않는다는 것입니다. 이 라디오 입력을 동적으로 폼에 추가하고 있습니다. 그리고 문서 유형이 나는
<!doctype html>
에 ASS HOLE IE
[여기] (http://stackoverflow.com/questions/1788639/javascript-doesnt-work-in-ie8) 답변을 찾을 수 있습니다. 짧게 : setAttribute에 의해 IE에서 타입이나 이름을 설정할 수 없습니다. 객체 도트 표기법을 사용하십시오 : rdo.type = 'radio'; rdo.name = 'radioOptions'; – Bora