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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:17:26+00:00 2026-06-07T19:17:26+00:00

In my project, I need to create a html5 CMS, my problem is how

  • 0

In my project, I need to create a html5 CMS, my problem is how to target a element in overlapping elements? like

<div id='L1'>
  <!--some text -->
  <div id='L2'>
    <!--some text -->
    <div id='L3'>
         <!--some text -->
    </div>
    <div id='L4'>
         <!--some text -->
    </div>
  </div>
</div>

I would like to target L1,L2,L3 and L4. Now the problem comes to I can use $(L1, L1 *) to target each element in L1, include L1 and bind ‘click’ event handler for them.

However when I click, let’s say L4, then not only contents of L4 comes out but also L1 and L2. I want to see contains of just that element, do not need is’s parent, what should I do?

Update:
I load a temple container via ajax, and bind event handlers for them

$('#load_area').load(file,function(){
$('#load_area *').click(
    function(){
        $('#edit_area').append($(this).html());//display what I have clicked
    }
);
});
  • 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-07T19:17:28+00:00Added an answer on June 7, 2026 at 7:17 pm

    the reason your code is behaving this way is your event is bubbling up the DOM, to prevent this behavior you can do one of the following

    $('#load_area').load(file,function(){
    $('#load_area *').click(
        function(event){
            event.stopPropagation();
            $('#edit_area').append($(this).html());//display what I have clicked
        }
    );
    });
    

    or

    $('#load_area').load(file,function(){
    $('#load_area *').click(
        function(){
            $('#edit_area').append($(this).html());//display what I have clicked
            return false; //event.stopPrpagation() + event.preventDefault()
        }
    );
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create a div carousel for a project Im working on. I
For my project i need a editable text ,so i decided to use some
For a school project I need to create a program and it'd be nice
I'm working on a project where I need to create a link that when
I need to create a GUID in an unmanaged windows C++ project. I'm used
I need to create a custom URI scheme for my project. i.e urn:myprotocol:{p1}:{p2}:{p3}:{p4} -
I need to create a block of unique lines to test a different project
For a project I'm working on, I need to create objects using different source
So I'm doing this project for my OO class. We need to create two
I want to create a new project in Xcode (4.2), but I don't need

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.