Him
Im trying to convert my jQuery script to a Prototype compatible one, but i cant seem to get it to work. Can someone please help me? Basically what it does is allow you to click an entire html table row to check/uncheck a checkbox.
$('input:checkbox').hide()
$('.clickable tr').click(function() {
var $checkbox = $(this).find(':checkbox').filter(':first');
$checkbox.attr('checked', !$checkbox.attr('checked'));
$(this).toggleClass('selected');
});
In Prototype you use
$$()to select elements with css-like selectors.This returns an
ArrayofElements. Then you could use the.each()method on the returned value:For events, you use the
Element.observe()method:(untested)