搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

the JS statement document.getElementsByName("PME_data_myfield").item(0).outerHTML=""; is not executed in FF, it works on all other browsers

  • 1 回覆
  • 10 有這個問題
  • 4 次檢視
  • 最近回覆由 cor-el

more options

I am trying to remove an input element from a form with the above statement in a javascript. It works on all other browsers but not on FF. It does not generate an error either. Instead of removing the item it just seems to be ignoring the statement.

I remove the element with the above statement and then re create a new one with document.createElement. In FF it duplicates the element.

I am trying to remove an input element from a form with the above statement in a javascript. It works on all other browsers but not on FF. It does not generate an error either. Instead of removing the item it just seems to be ignoring the statement. I remove the element with the above statement and then re create a new one with document.createElement. In FF it duplicates the element.

所有回覆 (1)

more options

Firefox only supports innerHTML and not outerHTML, so you need to use other code for Firefox.

See e.g.:

由 cor-el 於 修改