UNPKG

850 BMarkdownView Raw
1# OGLE-TR-122b
2
3OGLE-TR-122b is the smallest star know to man.
4
5OGLE-TR-122b the NPM library is a small abstraction over the DOM's APIs for creating elements. It's a fun experiment. Final build clocks in at 289 bytes of ECMAScript 5.
6
7#### Example
8
9```javascript
10import createElement from "ogle-tr-122b";
11
12document.body.appendChild(
13 createElement("div")
14 .setAttribute("class", "container")
15 .appendChild(
16 createElement("h1")
17 .setAttribute("class", "title")
18 .setTextContent("Please enter name:")
19 )
20 .appendChild(
21 createElement("input")
22 .setAttribute("placeholder", "name")
23 .setAttribute("autofocus", true)
24 .addEventListener("input", event => {
25 let { previousSibling, value } = event.target;
26 previousSibling.textContent = `Name: ${value}`;
27 })
28 )
29);
30```