document.createElement multiple arguments
NickName:Alon Amir Ask DateTime:2015-06-11T05:08:55

document.createElement multiple arguments

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.

Copyright Notice:Content Author:「Alon Amir」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/30767350/document-createelement-multiple-arguments

Answers
Blue 2015-06-10T21:15:39

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 a typeExtension 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.\n\nQuick edit: It does appear that chrome stable does contain the typeExtension parameter, which can be found here. Thanks @ScottMiles for the clarification.",


More about “document.createElement multiple arguments” related questions

document.createElement multiple arguments

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

Show Detail

Can document.createElement be combined

Can multiple elements be created without rewriting document.createElement() each time.. document.createElement("article"); document.createElement("footer"); document.createElement("header"); docum...

Show Detail

Is there a shorthand way to document.createElement multiple elements?

Is there a shorthand method in JS to document.createElement when you're creating a bunch of elements. To maximize usage of HTML5, and still make sites work in older browsers, I tend to have somet...

Show Detail

Send multiple arguments in .then function

In callbacks we can send as many arguments as we want. Likewise, I want to pass multiple arguments to a then function, either in Bluebird promises or native JavaScript promises. Like this: myPro...

Show Detail

Create a button dynamically and set "onclick" handler with accepts multiple arguments

I need to create a button in a loop dynamically and attach "onclick" event handler to it and then function for the handler is pre-defined and accepts multiple arguments. for (var i = 0; .....) { ...

Show Detail

Can we return document.createElement("element")?

I have to create an input box multiple times, so I call a function like this multiple times: function __createInputBox(id) { var input = document.createElement("input"); input.setAttribut...

Show Detail

Multiple arguments in sqllite in flutter

I would like to know how to pass multiple arguments to a raw query in sqllite. My code is below query() async { // get a reference to the database Database db = await DatabaseHelper.inst...

Show Detail

VBS - Multiple arguments

I am creating script to pass one or more arguments. The script works fine with one argument but with multiple arguments it fails. This is the code I have: Set WshShell = WScript.CreateObject("WSc...

Show Detail

Multiple document.createElement with eventListeners in One Function Return?

I have a function that returns something into the dom (a cellrenderer in ag-grid). Is it possible to create two different elements with document.createElement(), attach event listeners with

Show Detail

Multiple Command line arguments in C

I am wondering the best way to process multiple command line arguments. I have seen command line arguments done with switch and case statements like this: while ((x = getopt(argc, argv, "bic:")) ...

Show Detail