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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:40:29+00:00 2026-06-04T07:40:29+00:00

What I want to reach, is to generate dynamically text boxes with jQuery, so,

  • 0

What I want to reach, is to generate dynamically text boxes with jQuery, so, the jQuery code:

var num = $('.question-container-1').length;
var newNum = new Number(num + 1); 

var newElem = $('#question-container-' + num).clone().attr('id', 'question-container-' + newNum);            
newElem.children('input[type=text]').val('');

$('#question-container-' + num).after(newElem);

and the html code:

<fieldset id="question-container-1" class="question-container-1">
    <div class="control-group">
        <label class="control-label" for="input01">Întrebare</label>
        <div class="controls">
            <input type="text" name="question" id="question-box" value=""/>
        </div>
    </div>
</fieldset>

<fieldset>
    <div class="control-group">
        <div class="controls">
            <a href="#" id="add-question-1" class="add-question-1">Adaugă întrebare</a>
            <a href="#" id="delete-question-1" class="delete-question-1" style="margin-left: 20px;">Șterge întrebare</a>
        </div>
    </div>
</fieldset>

After all, everything works perfectly, except for one thing, they are clones from the last textfield, but I don’t want to copy the value of it as well, how you can see I tried with children function to find textfield, but it does not erase the value

  • 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-04T07:40:30+00:00Added an answer on June 4, 2026 at 7:40 am

    .children() works only one descendant level down. You want .find() instead, which goes all the way down to the last, farthest descendant. 😀

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Admittedly, I'm a bash neophyte. I always want to reach for Python for my
Want to code a key pad for an calculator. What I want to make
Want to send the text from my current vb application to the Active Window
I want to code a little Game, dealing with fonts and letters. I want
I want to reach parts of a large file randomly. After opening the part
A certain SOAP webserver I want to reach is configured to 'Accept client certificates'
I'm using express framework. I want to reach session data from socket.io. I tried
Given an undirected graph, I want to generate all subgraphs which are trees of
I want to reach x:Property nodes and their attributes: Xml: <Activity mc:Ignorable=sap x:Class=WebApplication3.work xmlns=http://schemas.microsoft.com/netfx/2009/xaml/activities
I have a string and it contains some words that I want to reach,

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.