Moving an element with a particular ID

Once an element is under our beck and call, we can send it somewhere else on the page.

How to do it...

In our HTML sketch, we are pretending to vote for the greater of two, very influential people. Each influence is represented by an element on the page with a unique ID attribute. Moving elements around when we know their unique ID attribute value is simple with the MooTool infused Element::inject() method.

<script type="text/javascript" src="mootools-1.3.0.js"></script> </head> <body> <form action="javascript:" method="get"> Choose the greatest influence of the Internet:<br/> <select id="influence"> <option value="">Vote Now:</option> <option value="bill">Bill</option> <option value="linus">Linus</option> ...

Get MooTools 1.3 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.