views:

29

answers:

1

Can someone please help me out with this? I'm using jquery-1.4.2.

http://jsfiddle.net/Ymkpb/

Thank you so much!

Edit - Adding the original so this is more useful later:

$$('.clickables').each(function(clickable) {
    var list = clickable.getElements('li');

    list.addEvent('click', function() {
        var link = this.getElement('a');
        if(this.getFirst('a')) {
            window.location = link
        }
    });
});​
+2  A: 

It would look like this in jQuery:

$('.clickables li').click(function() {
  window.location = $(this).children('a').attr('href');
});​

You can give it a try here

Nick Craver
That worked perfectly. Thank you!
Daniel O'Connor
@Daniel O'Connor: Don't forget to mark this as the correct answer :)
Alastair Pitts