Remove child nodes (or elements) or set innerHTML=“”?

后端 未结 3 1175
鱼传尺愫
鱼传尺愫 2021-01-18 21:27

When clearing HTML elements such as select boxes, tables, or lists, is it better/faster to remove the nodes (e.g., select.options.remove(i), table.deleteR

3条回答
  •  滥情空心
    2021-01-18 21:47

    In IE you cannot set the innerHTML of a select element. So for a cross-browser solution the only way is to add/remove child nodes.

提交回复
热议问题