Injecting Hello World into an HTML DIV

Let us add an element to the HTML Document Object Model (DOM).

Getting ready

There is no oldie that is more goodie than greeting the world around us. There is an elemental power to our first Hello World, a power that proclaims, "We have the power to code syntactically correct. We have the power to change things on the screen. We have the power to accomplish business goals using this language. And, we are friendly and outgoing; 'Hello'."

How to do it...

Here is an example that demonstrates MooTools' syntax and power:

<script type="text/javascript" src="mootools-1.3.0.js"></script> </head> <body> <div id="mycanvas"> Knock Knock, Who's there? Hello, who? </div> <script type="text/javascript"> var whocanitbenow ...

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.