Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const el = function(options) {
let node = document.createElement(options.type || 'div')
if (options.id) node.id = options.id
if (options.class) node.className = options.class
if (options.text) node.textContent = options.text
if (options.html) node.innerHTML = options.html
return node
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.