2012-08-03 51 views

回答

7

工作正常,在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);