2
當我試圖動態創建按鈕時,Internet Explorer顯示錯誤。儘管它是在第三行Internet Explorer 8不允許動態創建按鈕
當我試圖動態創建按鈕時,Internet Explorer顯示錯誤。儘管它是在第三行Internet Explorer 8不允許動態創建按鈕
工作正常,在Firefox
var deleteButton = document.createElement('input');
ratingSliderContainer.appendChild(deleteButton);
deleteButton.setAttribute('type','button');
deleteButton.setAttribute('value','delete');
它顯示錯誤不能修改輸入的type
一旦它被添加到DOM。嘗試重新排序你的陳述如下:
var deleteButton = document.createElement('input');
deleteButton.setAttribute('type','button');
deleteButton.setAttribute('value','delete');
ratingSliderContainer.appendChild(deleteButton);
什麼樣的錯誤? – 2012-08-03 15:27:20