jQuery Event Target for caller s reference

0 votes

I don't know if I have forgotten how to do so or if it's a bug, but I just can't find the caller's reference in the "click" event using jQuery.

I'm doing the following:

$(document).ready(function() {
    $('#parent a.item').click(doSomething);
});

function doSomething(e) {
    // Alerts for demostrational purposes only
    alert(e.target);
    alert(e.currentTarget);
    alert(this);
    alert($(this)[0]);
}

All the alerts show the hyperlink´s href attribute(page URL + '#').
Am I doing something wrong?

Notes: Using jQuery 1.4.2.

Aug 19, 2022 in Web Development by gaurav
• 23,260 points
502 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Web Development

0 votes
1 answer

Microsoft CDN for jQuery or Google CDN?

You should absolutely use the Google CDN ...READ MORE

answered Jun 22, 2022 in Web Development by rajatha
• 7,680 points
667 views
0 votes
1 answer

JQuery - Change event using element by name

How to trigger a event with event ...READ MORE

answered Jun 28, 2022 in Web Development by rajatha
• 7,680 points
2,978 views
0 votes
1 answer

Test jquery for vulnerabilities

The following blog post will help you. MKSB(en): ...READ MORE

answered Jun 30, 2022 in Web Development by rajatha
• 7,680 points
656 views
0 votes
0 answers

If/else else if in Jquery for a condition

I am having a set of text ...READ MORE

Jul 1, 2022 in Web Development by gaurav
• 23,260 points
2,804 views
0 votes
0 answers

how to get values of columns for a selected row through jQuery

here i am trying to fetch values ...READ MORE

Jul 1, 2022 in Web Development by gaurav
• 23,260 points
5,431 views
0 votes
0 answers

jquery $.each() for objects

<script> $(document).ready(function() { ...READ MORE

Jul 20, 2022 in Web Development by gaurav
• 23,260 points
284 views
0 votes
0 answers

jQuery.click() vs onClick

I have a huge jQuery application, and ...READ MORE

Feb 8, 2022 in Java by Rahul
• 9,680 points
678 views
0 votes
1 answer

How to distinguish between left and right mouse click with jQuery

Using the mousedown() method: The mousedown() method in ...READ MORE

answered Jun 14, 2022 in JQuery by gaurav
• 23,260 points
774 views
0 votes
0 answers

jQuery drag event doesn't seem to have deltaX property

I am trying to create my own ...READ MORE

Aug 8, 2022 in Web Development by gaurav
• 23,260 points
394 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP