Wednesday, February 04, 2009

イベント監視 prototype.jsと jquery

prototype.js

window.onload = function() {
$$('a.box').invoke('observe', 'click', function(){
alert('Hello world!');
});
}

jquery.js

$(document).ready(function(){
$("a.box").click(function(){
alert('Hello world!');
});
});


<a href="#" class="box" >link</a>

No comments: