JavaScript syntax generator for building HTML and XML strings
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Syntax generator for building HTML and XML strings

Example Usage:

ES(Tag Name, Inner Content [optional], JSON List of Tab Attributes [optional], Prefix String to a Tag [optional], Sufix String to a Tag [optional], ) returns a string

  ES("br") generates <br />
  ES("div", "Hello World!") generates <div>Hello World!</div>
  ES("span", "Hello World in RED!", {style: "color: red;", id: "MySPAN"}) generates 
    <span style="color: red;" id="MySPAN">Hello World in RED!</span>

Don't forget you can encapsulate tags:

  ES("p", "This is a paragraph") +
  ES("p", "This is a blue paragraph", {style: "color: blue;"})
  {style="margin-left: 10pt; padding: 5px; border: solid 1px blue;"}

You can see the code in action at:


This code is provided without warranty. While I strive to maintain backwards compatibility with previous versions, the code is still under active development. As this is the case, some revisions may break compatibility with earlier versions of the library. Please keep this in mind when using eSugar.

Copyright and Licensing

Copyright (c) 2012, 2016 Ervin Kosch, released under the GPL 3 license