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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:59:22+00:00 2026-06-09T04:59:22+00:00

I have a jquery variable: var $items = <input type=’text’ />; and I have

  • 0

I have a jquery variable:

var $items = "<input type='text' />";

and I have a cloned element:

var cloneA = $("#element").clone();

I cannot find a way to append cloneA to $items.

What could be the solution?

Thanks

  • 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-09T04:59:23+00:00Added an answer on June 9, 2026 at 4:59 am

    The problem is that you were not using $items as a jQuery object. You need it to be a jQuery object in order to use the .append() function on it.

    Wrapping the HTML string in the jQuery variable, $ will create an object with that HTML inside.

    Try this –

    var $items = $("<input type='text' />");
    var cloneA = $("#element").clone();
    $items.append(cloneA);
    

    I assume that this is simply pseudo code because you wouldn’t regularly want to be appending elements into an <input> element. Rather adding <input> fields into an existing element…

    Something slightly more logical would look like this –

    var $items = $("<div id="input_holder"></div>");
    
    // #element in this example is an actual <input> 
    var cloneA = $("#element").clone(); element.
    
    $items.append(cloneA);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have declared this variable in jquery var enabled = false; I want to
i have following variables in jquery var uemail=abc@domain.com,xyz@domain.com,gty@domain.com; var subj=test message; var text=<b>This is
I have a string of html text stored in a variable: var msg =
I have a knockout template like this: <script type=text/html id=list> <ul data-bind=foreach: items> <li
I have this jQuery snippet, I have stored the variables to highlight them. var
I have a variable with a jQuery collection in it, like this: $collection =
I have problem with Razor syntax and jQuery, I'm trying to append some items
I have a <div> with radioboxes: <div id='RB-01'> <span>Item_1</span><input type='radio' name='RB01' value='1'><br /> <span>Item_2</span><input
I have a setup like this... $(document).ready(function(){ var model = { /* some variable
Possible Duplicate: how to get GET and POST variables with JQuery? I have 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.