hi , in jQuery. i am invoking an event by class. how do you do same in Prototype.
$(".button").click(function() {
var element = $(this);
var Id = element.attr("id");
});
hi , in jQuery. i am invoking an event by class. how do you do same in Prototype.
$(".button").click(function() {
var element = $(this);
var Id = element.attr("id");
});
$$('.button').observe('click', respondToClick);
function respondToClick(event) {
var element = event.element();
var Id = element.id;
}
Event.observe($$('.button'), 'click', function(e) {
// ...
});