← Back to release summary

2nd arg of document.createElement should be an object

Category
DOM
Type
New or changed feature
Status
Enabled by default (Chrome 56)
Intent stage
None

Summary

This feature adds a dictionary as a second argument for document.createElement. The dictionary 'is' member is used to set custom element attribute. For now both syntaxes will be supported. Later on after v1 custom elements (https://www.chromestatus.com/features/4696261944934400) are shipped the string argument will be deprecated.

Standards & signals

Docs: https://dom.spec.whatwg.org/#dom-document-createelement

View on chromestatus.com