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 in Web Development by gaurav
• 18,960 points
25 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 in Web Development by rajatha
• 7,440 points
57 views
0 votes
1 answer

JQuery - Change event using element by name

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

answered Jun 28 in Web Development by rajatha
• 7,440 points
67 views
0 votes
1 answer

Test jquery for vulnerabilities

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

answered Jun 30 in Web Development by rajatha
• 7,440 points
35 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 in Web Development by gaurav
• 18,960 points
44 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 in Web Development by gaurav
• 18,960 points
672 views
0 votes
0 answers

jquery $.each() for objects

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

Jul 20 in Web Development by gaurav
• 18,960 points
13 views
0 votes
0 answers

jQuery.click() vs onClick

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

Feb 8 in Java by Rahul
• 9,240 points
70 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 in JQuery by gaurav
• 18,960 points
47 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 in Web Development by gaurav
• 18,960 points
29 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