0.2.2 • Published 7 years ago
flxels v0.2.2
flxels
Create HTML elements in JavaScript. TypeScript type definitions included.
API
Create element specified by tag.
function el (tag: string): HTMLElementCreate styled element specified by tag and styles object.
type StylesObject = { [key: string]: string | StylesObject }function styled (tag: string, styles: StylesObject): HTMLElementCreate styled or unstyled h1 element.
Styles object is optional.
function h1 (styles?: StylesObject): HTMLDivElementdiv span h1 h2 p input button
Add class to specified element.
function add_class (element: HTMLElement, className: string): voidRemove class from specified element.
function remove_class (element: HTMLElement, className: string): voidStyle specified element.
Adds a new css class on each call.
function style (element: HTMLElement, styles: StylesObject): voidRestyle specified element.
Assigns new css class.
function restyle (element: HTMLElement, styles: StylesObject): voidAdd text node to specified element.
function add_text (element: HTMLElement, text: string): voidRemove text node from specified element.
If string passed instead of text node, removes string from textContent.
If no text arg passed, removes all text nodes.
function remove_text (element: HTMLElement, textNode?: Text): void0.2.2
7 years ago
0.2.1
7 years ago
0.2.0
7 years ago
0.1.13
7 years ago
0.1.12
7 years ago
0.1.11
7 years ago
0.1.10
7 years ago
0.1.9
7 years ago
0.1.8
7 years ago
0.1.7
7 years ago
0.1.6
7 years ago
0.1.5
7 years ago
0.1.4
7 years ago
0.1.3
7 years ago
0.1.2
7 years ago
1.1.1
7 years ago
1.1.0
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago