I was reading through the polymer documentation, and I saw this:
var el2 = document.createElement('input', 'my-input');
Source
Forgetting about polymer for a second, can document.createElement
currently take 2 arguments? Is it related to Polymer's type-extensions?
Side note: Webstorm was "complaining" when I called it with 2 arguments.
At the moment,
document.createElement
will only take one parameter (Ignoring the second). It does appear that there is a spec that will allow you to pass atypeExtension
which you can read about here.This spec is still in the works, and is not implemented in any form on any browser as of yet.Quick edit: It does appear that chrome stable does contain the
typeExtension
parameter, which can be found here. Thanks @ScottMiles for the clarification.