O'Reilly logo

MooTools 1.3 Cookbook by Jay Larry G. Johnston

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required