What are the different ways to create elements

Let's say I want to overwrite form.elementsfor all forms (current and future).

Motivation

This issue of polyfillingRadioNodeList can be resolved by intercepting all the elements formand manually drawing a custom getter for the property elementson them.

How to intercept?

Besides below, there are other ways to create (form) elements that I need to intercept

  • document.createElement
  • document.createElementNS
  • Node.importNode
  • Node.cloneNode
  • DOMImplementation.createDocument(It may depend on how efficiently rewriting Document.prototype.createElement/ is NS)

What are the other disadvantages?

A separate question, ignoring performance, shows what good reasons exist for not intercepting node creation?

+5
source share
1 answer

, , , , , , .

- createElement on Element document , .

, IE HTC, .

, , ( ).

EDIT:

, DOM Cross-Browser (, , , 4 ), .

0

All Articles