I want to supply options of the function. Syntax is(https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement):
let element = document.createElement(tagName[, options]);
There are several related questions, but most answers recomends to create element, and then use element.addClass, for instance, or to create an independent Js function to achieve this. If there is a way to do it in a single line, providing array of options, how is it? Can you provide an example? Answer to this, will also help these: assigning DOM attributes with javascript's createElement function How can I add a class to a DOM element in JavaScript?