Skip to content

A handy shortcut lib to build html strings with javascript

Notifications You must be signed in to change notification settings

aceysmith/html.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Do fast HTML creation in JavaScript. Ready... GO!


Examples:

DIV()
<div></div>

DIV("HEY")
<div>HEY</div>

DIV({"id":"thing"})
<div id="thing"></div>

DIV(H1("HEY"))
<div><h1>HEY</h1></div>

DIV(["HEY",DIV()])
<div>HEY<div></div></div>

DIV({"id":"thing"},["HEY"])
<div id="thing">HEY</div>

BR()
<br />

BR({"id":"thing"})
<br id="thing" />

HTML(
  HEAD(),
  BODY(
    DIV(
      {"id":"mainDiv"},
      H1("HOWDY"),
      P("Example website")
    ),
    BR(),
    DIV({"style":"clear:both;display:block;"})
  ])
])
<html>
  <head>
  </head>
  <body>
    <div id="mainDiv">
      <h1>HOWDY</h1>
      <p>Example website</p>
    </div>
    <br />
    <div style="clear:both;display:block;"></div>
  </body>
</html>

About

A handy shortcut lib to build html strings with javascript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published