0.15.1 • Published 5 months ago

@olton/html v0.15.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

html

Create HTML pages in pure JavaScript!


Status

Dependencies Package Version NPM Version License: MIT Code size


Install

npm i @olton/html

of use from CDN:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@olton/html@latest">

Using

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="path-to/html.js"></script>
</head>
<body>

<script>
    ((() => {
        htmljs.extract()
        const body = document.querySelector("body")
        const root = document.createElement("main")
        body.appendChild(root)
        root.innerHTML = div(
            h1("Header"),
            form(
                label("Label", {class: "class1"}),
                input({type: "text", value:"123", data:{role: "input"}}),
                hr(),
                div(
                    button("Ok", {events: {onclick: "alert('Click Button')"}}),
                    button("Cancel", {type: "button"}),
                    {class: "actions"}
                )    
            )
        )
    })())
</script>
</body>
</html>

Documentation

Read about Html.js usage in the Metro UI documentation.

Support

If you like this project, please consider supporting it by:

  • Star this repository on GitHub
  • Sponsor this project on GitHub Sponsors
  • PayPal to serhii@pimenov.com.ua.
  • Patreon
  • Buy me a coffee

Copyright (c) 2025 by Serhii Pimenov

0.12.0

12 months ago

0.14.0

7 months ago

0.15.0

6 months ago

0.14.1

6 months ago

0.15.1

5 months ago

0.14.2

6 months ago

0.10.0

1 year ago

0.11.0

1 year ago

0.8.1

1 year ago

0.8.0

1 year ago

0.5.0

1 year ago

0.7.0

1 year ago

0.6.0

1 year ago

0.4.1

3 years ago

0.4.0

3 years ago