0.4.1 • Published 7 years ago

betterelement v0.4.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

BetterElement Build Codecov Docs

Create your own elements through client-side JavaScript.

Installation

npm i betterelement
# or, with Yarn,
yarn add betterelement

Usage

// First, create a new Element.
var element = new Element('hello');
// Then, let's add a toExecuteOnRead.
element.toExecuteOnRead = function (index, element) {
	element.innerHTML = 'hello';
	if (Math.random() < 0.51) {
		element.innerHTML += ' world!';
	} else {
		element.innerHTML += ' death!';
	}
}
// Now, let's build.
element.readElements();
...
<body>
	<h1><hello></hello></h1>
	<p>
		...
	</p>
	...
</body>
...

Results in:

...
<body>
	<h1><hello>Hello, death!</hello></h1>
	<p>
		...
	</p>
	...
</body>
...

For more examples, see doClock and doRandom in betterelement.js. Here it is in action!

0.4.1

7 years ago

0.4.0

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago