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

  • Home
  • SEARCH
  • 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 3242500
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:19:21+00:00 2026-05-17T18:19:21+00:00

I have a page with 3 tabs on it. The first tab has a

  • 0

I have a page with 3 tabs on it. The first tab has a few cancel images with the class “cancelBtn”.

<img src="images/cancel.gif" alt="Cancel Order" class="cancelBtn" id="49" />

The first time the page loads the click event fires fine, if I move away from the frist tab and return the click event doesn’t fire. Each time a tab is clicked the html used on the tab including the cancel button is retrieved from the server.

Does anyone know why the event only fires on when the page is loaded? thanks

$(function () {
    $(".cancelBtn").click(function () {
        alert('hello');
        $.ajax({
            type: "POST",
            url: "Default.aspx/CancelOrder",
            data: "{}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                $("#divResult").html(msg.d);
            }
        });
    });
});
  • 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-17T18:19:22+00:00Added an answer on May 17, 2026 at 6:19 pm

    Each time a tab is clicked the html used on the tab including the cancel button is retrieved from the server.

    The click() event assigns the function only to the elements that exist at the time when it’s called. Use live to bind the event to “future” elements as well.

     $(".cancelBtn").live("click", function() {
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a php page. This has multiple images which looks like tabs. With
I got this an asp.net 3.5 page that and I have few tabs (telerik
I have a page that has haschhange tabs so when I click on a
I have a tab-control that has 4 tab pages. Each tab page contains a
I have a simple web page that has 3 tabs in my main content
I have a few tabs on a page and it always defaults to the
I have an ajax toolkit TabContainer control on my page with a couple tabs.
I have a page with a Google Maps mashup that has pushpins that are
I am having a problem with Jquery Tabs. On my MVC page, I have
I have a UITabbarController set by the Interfacebuilder. The tabbarcontroller has 5 tabs, the

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.