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

Creating an "A" tag link that alters the src of an IFRAME

Imagine how our alarm clock works. We set a listener, so to speak, on the device such that it listens and waits for the action of the time we wish to receive an alarm. In our HTML DOM, we can add listening events as properties when we create an element. When the listener is fired, the defined action will execute!

How to do it...

Create an anchor tag, set a listener on it, and define the action to take when the listener is activated, in other words, do something when the link is clicked:

<iframe id="miframe" src="http://bing.com" width="800" height="400"></iframe> <style type="text/css"> a { cursor:pointer; display:block; color:#00F; text-decoration:underline; font-size:20px; } </style> <noscript>JavaScript ...

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