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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:40:37+00:00 2026-06-14T11:40:37+00:00

I have the following markup: <div style=height:100px; width:280px; float:left > <p style=float:left; padding:5px; id=optionOne>

  • 0

I have the following markup:

<div style="height:100px; width:280px; float:left" >

<p style="float:left; padding:5px;" id="optionOne">

<label style="cursor:pointer; width:100px" id="optionLabelOne">Option 1</label>
<span style="color:red; font-size:10px"></span>

<input class="u-3" name="ageGroup" id="ageGroup" style="width:230px;" />
</p>

 </div>

I have several such repeating divs. I select

tags inside them like this:

$('#optionOne,#optionTwo,#optionThree,#optionFour').on('mouseover',function(){
 $(this).on('mouseover',function(){
  //do something here});
  });

Now at some later stage i need to execute a click event on “p” tag excluding the “input” tag that lies within.

When i use the below code, click event fires up on input field as well (obvious)

$(this).on('click',function(){
//do something
});

So what can be done to select the complete p tag without doing anything to input element within.

I tried this as well:

$(this).not('input').on('click',function(){
 //// NOT WORKING
 });

Please comment.

  • 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-14T11:40:38+00:00Added an answer on June 14, 2026 at 11:40 am

    You can use stopPropagation method of the event object:

    $('p input').on('click', function(event){
         event.stopPropagation()
    })
    

    Note that there is no need to bind a handler to this object as you have selected all the elements:

    $('#optionOne,#optionTwo,#optionThree,#optionFour').on('mouseover',function(){
        // 
    });
    

    You can also add a class to the p tag and use class selector:

    $('p.options').on('mouseover',function(){
        // $(this).foo()
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following markup: <div style=overflow:auto;width:500px;height:100px;> <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li>
I have the following markup code in my page: <div id=root_img style=width:100%;height:100%> <div id=id_immagine
If I have the following markup <div id=previewNote class=note yellow style=left:25;top:25px;z-index:1;> <div class=body></div> <div
I have following HTML markup, <div id=subcontent_l> <p> <a href=/membership-packages/><img height=202 width=644 alt= src=http://74.52.72.231/wp-content/uploads/2010/06/banner1.jpg
I have the following markup: <div style=width: 660px; border-bottom: 1px solid #3A3F46;> <div class=noplace_event_cont>
I have following markup: <div class=twocol float-left> <h4>left</h4> <p>first</p> <p>second</p> <p>third</p> </div> <div class=twocol>
Assume I have following markup: <div id =About style=height: 2000px> About </div> <div id=Work
I have the following ASP.NET markup: <div id=myForm title=My Form style=display: none> <span>You can
I have the following markup for my input fields: <div class=required> <label for=Name>Name <em>*</em></label>
I have the following markup <div class=content chapters current-tab> <div class=right> <div id=chapters-container-29 style=>

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.