Skip to content

Latest commit

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

lfn 🐘

Like an h function but constructs real DOM trees

Small (509b) helper function to make working with HTML in JS a little easier.

Usage:

l(tagname,[props[, ...children]]);

Examples:

import{l}from"lfn.js";// only tagnameconstdiv=l("div");// tag and childrenconstheading=l("h1","hello"," world");// tag and propsconstinput=l("input",{name: "name"});// tag, props and childrenconstbuttons=l("div",{style: "display: flex; "},l("button",{id: "btn_one"}),l("button",{id: "btn_two"}));// orphan tags (rendered as a document fragment)constfragment=l(l("style",` :host { display: block; content: contain; }	`),l("div","hello world"));

About

Generate DOM nodes from JS 🐘

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages