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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:08:32+00:00 2026-06-14T16:08:32+00:00

Possible Duplicate: Bind an event handler on a element who’s inserted by the jQuery

  • 0

Possible Duplicate:
Bind an event handler on a element who’s inserted by the jQuery .html() function

Below is a simple jquery script. When the user hit #FAC a textbox appears, the value is entered. When #cs is clicked the valued entered in #NC should appear as alert. But it does not, any ideas to why?

$('#FAC').click(function() {
        $('#FAC').html('<input type="text" name="NC" id="NC"><input type="button" value="Ok" id="CS">');
    });

    $('#NC').click(function() {
        alert($('#NC').val());

    });
  • 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-14T16:08:33+00:00Added an answer on June 14, 2026 at 4:08 pm

    If I have understand well your problem try this:

    JSFIDDLE

    $('#FAC').bind("click",function() {
        $('#FAC').unbind("click");
        $(this).html('<input type="text" name="NC" id="NC"><input type="button" value="Ok" id="CS">');
    })
    
    $(document).on('click', '#CS', function() {
        alert($('#NC').val());
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: jQuery bind click ANYTHING but ELEMENT I have this HTML <div id=outer>
Possible Duplicate: Bind multiple events to jQuery 'live' method I have the following function:
Possible Duplicate: nearest ancestor node in jQuery html: <div class=post> <h2><a href=# title=>Pellentesque</a></h2> <p><a
Possible Duplicates: Is there an “exists” function for jQuery jQuery determining if element exists
Possible Duplicate: std::bind a bound function void foo0(int val) { std::cout << val <<
Possible Duplicate: Bind function to multiple events of different elements at once I need
Possible Duplicate: jQuery AutoComplete Trigger Change Event I am using jQuery UI v1.9 and
Possible Duplicate: jquery .bind() and/or .ready() not working Why is there a difference in
Possible Duplicate: Can main function call itself in C++? I found this problem very
Possible Duplicate: Bind textbox to 'enter' key I have a search text box. I

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.