Skip to content

Instantly share code, notes, and snippets.

@adriancooney
Created July 3, 2013 02:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adriancooney/5915015 to your computer and use it in GitHub Desktop.
Save adriancooney/5915015 to your computer and use it in GitHub Desktop.
<body>
  <div>
		<header>
			<h1 id="title"><em><a href="/">Hello world!</a></em></h1>
		</header>
		<section>
			<ul>
				<li class="item"><a href="#">Navigation Item</a></li>
				<li class="item"><a href="#">Navigation Item</a></li>
				<li class="item"><a href="#">Navigation Item</a></li>
				<li class="item"><a href="#">Navigation Item</a></li>
				<li class="item"><a href="#">Navigation Item</a></li>
			</ul>
		</section>
	</div>
</body>
//Lets get the title link
V.div.header.h1.em.a.href = "http://google.com"
V("#title").em.a.innerText = "New title!";

//Let's get those navigation items
V.div.section.ul.li.forEach(function(li, i) {
	li.a.innerText = "Link #" + i;
});
V.div.section.ul.li[3].classList.add("Highlighted!");

//How about we create some content
var content = V.create.div.class("content")
	.section.mult(5).p.em.text("Hello world!");

V.div.appendChild(content);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment