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: input type=button id=addButton1 class=myButton / input type=button id=addButton2 class=myButton / script type=text/javascript $(document).ready(function() { $('.myButton').click(function() {

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

2010-01-05 Thread CoffeeAddict
I understand that I can use the .click() method on a hyperlink element. But how do I know which element was clicked? First I have to gain reference to the hyperlink's ID. So lets say I have a page of hyperlinks like this in view source: ...someurl somebutton ...someurl somebutton

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

2010-01-05 Thread Charlie Griefer
input type=button id=addButton1 class=myButton / input type=button id=addButton2 class=myButton / script type=text/javascript $(document).ready(function() { $('.myButton').click(function() { alert($(this).attr('id')); // alert(this.id) -- should also