Skip to content

ricklancee/imperative-dom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Imperative DOM

import {div, ul, li, a} from './dom';

const items = ['foo', 'bar', 'baz']

const container = div({ className: 'container'},
  div({ className: 'ul-container', dataRef: 'hello' }, ul(
    items.map(item => li(a({className: 'li-link', href: `${item}`}, item)))
  ))
)

document.body.appendChild(container)

About

A simple way to imperatively create HTMLElements

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published