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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:57:39+00:00 2026-06-17T08:57:39+00:00

I am having an issue where a table row has a click event, but

  • 0

I am having an issue where a table row has a click event, but when a user clicks a link in one of the table row’s cells I do not want the row’s click event to fire.

Imagine a case where a table cell has a link within it and normally clicking the empty areas of any of the table rows (e.g. not links) causes some action like an accordion/row collapse and expand.

What is occurring is that the click event below is firing then the link is followed (the intended action).

What I need to happen is to exclude clicking the a href’s within a from triggering the tr.title-row click action (e.g. the alert should not fire and the link should be followed).

This jQuery code is setting up click events for the title row (e.g. all the TH’s in that row, any cells, etc.)

$(document).ready(function() {
$(".report tr.title-row").click(function() {
    alert('I am firing!');
});

Here is the same HTML this applies to:

<table width="100%" cellspacing="0" cellpadding="0" border="0" class="report">
  <tbody>
    <tr class="title-row">
      <th width="340"><span class="title">Test</span>
      </th>
      <th width="130" class="center-cell">Test</th>
      <th width="90" class="status"></th>
      <th></th>
      <th width="160"> <a target="_self" href="http://www.google.com" class="link-class sub-class">I am triggering the TR click event</a>
      </th>
    </tr>
    <tr>
      <td class="sub-row" colspan="5">
        <table width="100%" cellspacing="0" cellpadding="0" border="0">
          <tbody>
            <tr>
              <td><strong>SubRow</strong>
              </td>
              <td width="90" class="status"><span class="sub">Sub</span>
              </td>
              <td width="120"></td>
              <td width="160"><a title="Continue" href="http://www.yahoo.com">Something</a>
              </td>
            </tr>
          </tbody>
        </table>
      </td>
    </tr>
  </tbody>
</table>
  • 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-17T08:57:40+00:00Added an answer on June 17, 2026 at 8:57 am

    Can check the target of the row click and only run code if target isn’t an <a> tag:

    $(".report tr.title-row").click(function(event) {
    
        if( ! $(event.target).is('a') ){
            alert('I only fire when A not clicked!');
         }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having an issue bending my head around this one. I have a table
Im having a weird issue. My employee table has id ->int(11) as primary key.
I am having an issue with one of my .php pages. adddata.php has a
I'm having an issue with stopping event propagation. Imagine this scenario: <table id=test> <tbody>
I'm having an issue trying to NOT select a tablerow with the function: $(tr).click(function(e)
I'm having this issue where i use nth-child(odd) to color a table. In IE9
I am having an alignment issue in Firefox with my table. In Chrome/IE, it
I have a table that displays data for the user. Each row can have
I am having an issue with model associations. I want to pull a route's
I am having a paging issue with my RLDC report that has a SubReport.

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.