MooTools - Target

css

<style>#square{width:200px;background:#006699;color:#fff;padding:10px;}#box1{background:#333;padding:10px;margin:10px 0}#box2{background:#666;padding:10px}</style>

html

<div id=square>Square<div id=box1>Box1</div><div id=box2>Box2</div></div><div id=out></div>

js

<script>window.addEvent(domready, function(){$(square).addEvent(click, function(e) {var t1 = $(e.target).get(text);$(out).set(text,t1);});});</script>

Related Posts

MooTools window size, MooTools News Ticker, MooTools Tween, MooTools mouse position, MooTools mouse position