1.0.0
Creates an element with a given object of attributes
The tag name of the element such as 'div'
The attributes of the element
The created HTMLElement
import { gen_element } from 'kitto'const element = gen_element('div', { class: 'container', onclick: () => console.log('clicked')})document.body.appendChild(element) Copy
import { gen_element } from 'kitto'const element = gen_element('div', { class: 'container', onclick: () => console.log('clicked')})document.body.appendChild(element)
Version
1.0.0
Remarks
Creates an element with a given object of attributes
Param: tag_name
The tag name of the element such as 'div'
Param: attributes
The attributes of the element
Returns
The created HTMLElement
Example