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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:28:04+00:00 2026-05-28T03:28:04+00:00

Fellas, I am creating a text box dynamically, on a button click. User types

  • 0

Fellas,

I am creating a text box dynamically, on a button click. User types a value in it. Now, how do I extract the value from the text box? I’ve tried with .keyup() and .change() but cant get it to work. Ive spent hours now. Is there any help out there?

The button html code –

<input type="button" value="Verify" id="addButton" class="verifybtn">

JQuery for creating the text box on the fly and then trying to read the value entered –

$(document).ready(function(){
var ctr=0;
$("#addButton").click(function () {

    if ( ctr < 1 ){
    $('.verifybtn').after('<div id="TextBoxDiv1"><label>Enter Verification Code : </label><input type="textbox" size=5 id="textbox1" class="textbox1"></div>');
id="textbox1" class="textbox1">');
    ctr++;
    }
});

$("#textbox1").keyup(function(){
    value = $("#textbox1").attr('value');   
    alert(value);
});

$("#textbox1").change(function() {
  alert('Handler for .change() called.');
});

});

If you can either quickly point out what Im doing wrong, or suggest alternative ways of achieving this, I shall be ever thankful.

-DM

  • 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-28T03:28:04+00:00Added an answer on May 28, 2026 at 3:28 am

    You could also get it as:

    
    $("#textbox1").live('keyup', function(){
        value = $("#textbox1").val();   
        alert(value);
    });
    
    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sup fellas, I am using the script that a fellow stack overflow user posted
Fellas! I'm creating my first independent project in Rails 3. This is mostly for
Hey fellas, so I am able to display annotations (2) from the source code
Hey fellas, I have the following VBA code. It gets the values from an
Hello good fellas i'm sure everybody is cool.I'm about to start a tutorial about
Fellas, I have a database with columns named line1, line2, line3, line4, line5, line6.
Hey fellas, I have this weird bug, and I have no clue how to
good fellas. I have another very basic question that I need help with. I
Hello gud fellas in my quest of learning spring, i created a web application
I have a onclick event that has a value in it that I want

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.