Re: [jQuery] How to gain reference to hyperlink that is clicked

2010-01-06 Thread CoffeeAddict
Ah, (this), I'm a newbie to that in jQuery. Thanks. Charlie Griefer wrote: > > > > > > $(document).ready(function() { > $('.myButton').click(function() { >alert($(this).attr('id')); >// alert(this.id) <-- should also work > } >

Re: [jQuery] How to gain reference to hyperlink that is clicked

2010-01-05 Thread Charlie Griefer
$(document).ready(function() { $('.myButton').click(function() { alert($(this).attr('id')); // alert(this.id) <-- should also work } }); Notice that I added a class="myButton" to each button element, and set the listener for $('.myBu