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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:29:44+00:00 2026-05-19T11:29:44+00:00

I added a span with a class, but .click does not trigger. Adding a

  • 0

I added a span with a class, but .click does not trigger.

Adding a span class code

var TA = '<span class="TS" id="'+$('#TT').attr('value')+'" style=" color:#fff; margin-left:5px; font-family:arial; font-size:12px">* '+$('#TT').attr('value')+'</span>';
$('#QLT').append(TA);

This adds a span .TS to a div .TX. I want to trigger .TS using .click, the code

  $('.TS').click(function() {
   alert("ok");

  });

But this does not trigger. What is wrong, Appreciate all assistance.

Thanks
Jean

  • 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-19T11:29:44+00:00Added an answer on May 19, 2026 at 11:29 am

    You probably defined the click handler before you did $('#QLT').append(TA). Thus the click handler didn’t know about the new element with class .TS when it was bound.

    You can manually re-bind it, or use jQuery’s cool live function, which will automatically bind when a new element with class TS is inserted into the DOM:

    $('.TS').live('click', function() {
       alert("ok");
      });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

With jquery I am adding a div and appending the text click to view
I have this jQuery code and I'm not sure if it can be optimized
I have a series of nested UL's that are like this: <ul class=categorySelect id=>
My problem must be very simple to solve for many of you but I
Well, this must be very simple to do for most of you, but I
Essentially what I have is an entity class (Article) and one article may belong
I have have a a function that when a checkbox is checked i dynamically
I have a div I want to hide when clicking outside it. It almost
Document doc = Jsoup.connect(http://reviews.opentable.com/0938/9/reviews.htm).get(); Element part = doc.body(); Elements parts = part.getElementsByTag(span); String attValue;
I am using the TinyMCE editor. I have a div element. When an edit

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.