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
> }
>
$(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
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
...some
3 matches
Mail list logo