2012-06-22 39 views
0

如何在prototypejs中编写以下jquery?原型js中的点击函数

<a class="button view" style="cursor:pointer" id="addComment"></a> 

$(function() { 
$("#addComment").click(function(){ 

     alert("hello world"); 
    }); 
}); 

回答

1

Working demo

Event.observe('addComment', 'click', function(event) { 
    alert('u clicked on click here'); 
});​ 
+0

请了投票,如果这有助于你:) –