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 8379339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:09:22+00:00 2026-06-09T16:09:22+00:00

<div class=hidden id=build_blankrow> <span class=track_title></span> <span class=track_time></span> <span class=track_artist></span> <span class=track_album></span> <span class=track_number></span> <span

  • 0
<div class="hidden" id="build_blankrow">
    <span class="track_title"></span>
    <span class="track_time"></span>
    <span class="track_artist"></span>
    <span class="track_album"></span>
    <span class="track_number"></span>
    <span class="track_options">
        <span class="track_options_download"></span>
        <span class="track_options_addtoplaylist"></span>
        <span class="track_options_playnow"></span>
    </span>
</div>

This is a hidden DOM element used to render a results page for a search (AJAX). I clone(true) the above elements and append it to the page, after updating and filling in the valid information. The problem stems from the fact the elements within the class “track_options” should behave in alternate ways. I see other questions on StackOverflow that remove behavior completely by preventing the default action (will link at the end of this post) but I want to remove the onClick event inherited from the parent and add an action specific to each element.

Still new to StackOverflow, so please feel free to ask any questions you feel would be beneficial.

Thank you everyone for even a pointer in the right direction!

unbind onclick event for 'a' inside a div with onclick event

  • 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-06-09T16:09:24+00:00Added an answer on June 9, 2026 at 4:09 pm

    You’re quest is a little confusing, but I’ll try to give a complete break down of just a few of the many ways to achieve your goal.

    • First

    If you are trying to create a click for the parent Div that is not triggered by specific children then you can simple use event.stopPropagation() as so:

    // Noticed I did not use an ID call here for your parent div, the reason is simple,
    // You stated you use it like a "template" and clone it, or at least parts from it, thus it might 
    // (depending on how you use it) have multiple positions in your document, thus, one set ID just 
    // will not do.  So I pretended as if you had already added a similar named class to the parent
    // div, thus calling forth this click function on ALL div's containing said class
    $(".build_blankrow")
        //  This call to .live will ensure you can call the click function dynamically 
        //  on "future" created divs containing the same class name
        .live("click", function(e) { /* do work */ })
        //  This is called "chaining" in jquery
        //  Our .live click func returns the originally called '$(".build_blankrow")'
        //  ALSO: in NEWER jQuery, .live is replaced with .on
        //  Thus we dont need to make a new call just to get to its childrean
        //  .find will allow us to search the children for exactly what we need
        //  in this case we're grabbing the span with the class 'track_options'
        //  and setting its click func (this will effect its children) to stop propagation to parents
        .find(".track_options")
        .live("click", function(e) { e.stopPropagation(); });
    
    • Second

    You may not want that stop prop on all children of track_options, thus you make use of .filter(). This handy jQuery func will allow you to stop prop on exactly the inner elements of track_options you choose. See example below:

    //  You will notice not much change at start
    $(".build_blankrow")
        .live("click", function(e) { /* do work */ })
        .find(".track_options span")
        //  Here comes the change, gota love .filter
        //  Here I will get only the children elements for download and play now
        .filter(".track_options_download, .track_options_playnow")
        //  KEEP IN MIND, if your using NEWEST jQuery, then replace .live with .on
        // like so: .on("click", funct.....
        .on("click", function(e) { e.stopPropagation(); console.log("WHAT"); });
    
    • Third

    You could make use of CSS selectors in jQuery to come up with clever ways to reach each element as desired. Something like:

    $(".build_blankrow")
        .on("click", function(e) { /* do work */ })
        //  Here I use simple CSS to filter out the autoplaylist child
        .find(".track_options span:not(.track_options_addtoplaylist)")
        .on("click", function(e) { e.stopPropagation(); });
    

    Important jQuery Links used in previous code:

    1. .live()
    2. .on()
    3. .click()
    4. .find()
    5. .filter()
    6. .stopPropagation()
    7. jQuery Selectors

    Something else that maybe of interest (and I’d show example except I have to go deal with a 4 year old not wanting to eat! grrr) is .andSelf(). It will allow to make a call to get track_options and 1 or 2 of its children like so: $(".track_options).find("span:not(.track_options_addtoplaylist)").andSelf();

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an element like this: <div id=foo_<?php echo $id;?> class=hidden></div> I'm trying if
JQuery-ui will generate a div with a calendar-div class. Sadly this div is no
I have something like this currently: <div class = className style = position: absolute;
i have my html something like this... <div class = content> <div class =
I have a div class named switch control which has a div class named
I am trying to hide the div class hideme based on value of full_day
I want to scale the picture to fit the main div class http://jsfiddle.net/EyW99/ Sorry,
<div class = a> <div class = a b> text </div> </div> <script> alert($(.a).html());
for example I have the following: I want to go through each div class
My div with class name 'header-body-right' doesn't seem to be floating to the left

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.