Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 575817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:58:51+00:00 2026-05-13T13:58:51+00:00

simplified, i’ve got following code: <a id=123 href=#><span>click</span><span>me</span></a> when i click on ‘click’ and

  • 0

simplified, i’ve got following code:

 <a id="123" href="#"><span>click</span><span>me</span></a>

when i click on ‘click’ and ‘me’ it doesnt seem to work with following jquery selector:

 $("a").click...

maybe its because i click on the children? how could i write the selector so it maps to all children in ‘a’?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:58:51+00:00Added an answer on May 13, 2026 at 1:58 pm

    [updated]
    The problem is that you are using the wrong tool for the job (namely the event.target property). This will return the element that the event happened on.. but not the element in the bubbling phase that handles the event… you need to use the event.currentTarget..
    But in jQuery’s case this is also the same as the this keyword inside the handler …
    ref: http://api.jquery.com/event.currentTarget/

    Have a read at the Event order as explained at quirksmode. Special attention to Use of event bubbling and currentTarget


    [previous answer]
    Make sure that inside the .click method you use a function pointer or an anonymous function ..

    so

    $("a").click( function() {/*...*/} ); // anonymous function
    

    or

    function some_function()
    {
    //...
    }
    $("a").click ( some_function ) // function pointer
    

    but not

    $("a").click ( some_function() ) // unless some_function returns a function pointer..
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My simplified and contrived example is the following:- Lets say that I want to
Simplified for example, I have two tables, groups and items . items ( id,
Problem (simplified to make things clearer): 1. there is one statically-linked static.lib that has
Here's a simplified version of what I'm trying to do : Before any other
Here is a simplified version of my database model. I have two tables: Image,
Below is my (simplified) schema (in MySQL ver. 5.0.51b) and my strategy for updating
Here is a simplified version of my application showing what I'm doing. /* in
I have models (simplified example): class Group(models.Model): name = models.CharField(max_length = 32) class Person(models.Model):
Im getting a string (simplified) from the backend that should be : { menu:
Here's a simplified version of my class: public abstract class Task { private static

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.