1.2.1 • Published 7 years ago

dom-tagged-template v1.2.1

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

DOM helper to create elements/fragments similarly to jsx Build Status

const $ = require('dom-tagged-template');

const ul = $`<ul onClick=${e => {e.target.style.color=`hsl(${Math.floor(360*Math.random())},100%,50%)`}}>
	${[1,2,3].map(x => $`<li>${x}</li>`)}
</ul>`.firstChild;

const div = $`<div>
	<u onClick=${console.log}>Hello ${'!'.repeat(4)}</u>
	${ul}
</div>`.firstChild;

const fragment = $`
	<i>hello</i>
	@
	<br/>
	<marquee>world</marquee>
`;

live example

1.2.1

7 years ago

1.2.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago