Better DOM element builder inspired by zen-coding.
If type selector is not given, <div>
element will be used by default.
$z();
$z('h1');
Output:
<div></div>
<h1></h1>
$z('#main');
$z('section#page');
Output:
<div id="main"></div>
<section id="page"></section>
$z('.content');
$z('p.error.critical');
Output:
<div class="content"></div>
<p class="error critical"></p>
$z('div>ul>li');
Output:
<div>
<ul>
<li></li>
</ul>
</div>
$z('form>p+button');
Output:
<form>
<p></p>
<button></button>
</form>
$z('p{hello}');
Output:
<p>hello</p>
$z("input[name=\"hello\"][type='hidden'][disable][value=test]");
Output:
<input name="hello" type="hidden" disable="disable" value="test" />
$z('header>h1#title{hello}+p#message.error.critical{oops}');
Output:
<header>
<h1 id="title">hello</h1>
<p id="message" class="error critical">oops</p>
</header>