diff -r 000000000000 -r 40c8f766c9b8 src/cm/media/js/lib/yui/yui3.0.0/examples/event/event-simple_clean.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/cm/media/js/lib/yui/yui3.0.0/examples/event/event-simple_clean.html Mon Nov 23 15:14:29 2009 +0100 @@ -0,0 +1,98 @@ + + + + + +Simple DOM Events + + + + + + + + + + + + + + + +

Simple DOM Events

+ +
+

Clicking in the blue box will pop up a "Hello World!" alert window. Clicking on the first link will take you to the YUI website; clicking on the second link, which has the same href attribute, will pop up an alert instead and not navigate to a new page.

+ +

Event Utility is used here to do two things:

+ +
    +
  1. Attach the click event handler to the blue box;
  2. +
  3. Attach an event handler to the second <a> element that uses preventDefault() to prevent the link, when clicked, from navigating to a new page.
  4. + +
+
+ + + + + + + +
+

Click for Hello World alert.

+
+

The YUI Library. (Link navigates away from page.)

+ +

The YUI Library. (Link's default behavior is suppressed.)

+ + + + +