Skip to content

Simple JS function to quickly create DOM elements with attributes and innerHTML content

Notifications You must be signed in to change notification settings

stranothus/create

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

create

Simple JS function to quickly create DOM elements with attributes and innerHTML content

Usage

$create() is used to create a singular HTML element with attributes and innerHTML content. You can essentially write in JSX.

Special rules:

  • Whitespace won't show up in attributes of the parent element. Use %20 instead
  • You can only create one parent element at a time Make sure to include proper opening and closing tags

You can use $create() to directly append DOM elements, or you can store it in a variable. Since it's written with raw JS, you can manipulate it's content, attributes, event listeners, etc. just like any other DOM element's

About

Simple JS function to quickly create DOM elements with attributes and innerHTML content

Resources

Stars

Watchers

Forks

Packages

No packages published