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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:08:18+00:00 2026-06-13T01:08:18+00:00

I have a form that appears by append(). The form contains input that need

  • 0

I have a form that appears by append(). The form contains input that need to be adjusted with with js (autocomplete function).
Here is it:

function addForm() {    
<!-- function code here-->
...
html += '  <table class="form">';
html += '    <tr>';
html += '      <td>Entry product</td>';
html += '      <td><input type="text" name="product" value="" /></td>';
html += '    </tr>';
html += '    <tr>';
html += '    <td>&nbsp;</td>';
html += '    <td><div id="featured-product" class="scrollbox">';
html += '    </div>';
html += '    <input type="hidden" name="featured_product" value="" /></td>';
html += '    </tr>';
html += '  </table>';

$('#form').append(html);

}


$('input[name=\'product\']').autocomplete({
<!-- function code here-->
}

But autocomplete function doesn’t work in this way. As I understand it is because of append(html) doesn’t store the html to DOM. It works fine with usual html form, but i can’t go this way. I need to create forms as described. So the questions are:

How can i apply js to element that are not in DOM?
Or how can I execute this elemnt to DOM with js?
Maybe I need to use smth another like append()?

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-13T01:08:20+00:00Added an answer on June 13, 2026 at 1:08 am

    Put this code:

    $('input[name=\'product\']').autocomplete({
     <!-- function code here-->
    });
    

    after the code that appends the html. The problem is that when this bind is attempted the DOM does not contain these elements

    You could also use the .on functionality to apply this:

    $('input[name=\'product\']').on("autocomplete",function(){
     <!-- function code here-->
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a main form that contains an inner form (that inner form appears
I have a form that sends money value e.g <input type=text name=amount value=N50,000.00 NGN
I have a Windows form that's generated using code (including buttons and what not).
I have a simple HTML form that posts to a PHP page, which will
I have an HTML form that a user can add an arbitrary amount of
I have a form that appears as shown in the attached image. I have
I need to have an Add Features button that will append the following text
I have a form that contains multiple partners that share a pool. The partners
I have registration form on my website that, using jquery I append default values
If I have a form that contains a frame, and I edit the frame's

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.