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() {
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
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
3 matches
Mail list logo