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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:20:28+00:00 2026-05-25T19:20:28+00:00

JavaScript application often use one of the following methods: They use empty HTML elements

  • 0

JavaScript application often use one of the following methods:

  1. They use empty HTML elements (which exist in markup but are invisible because of display:none)
  2. They generate markup dynamically
  3. A combination of both

What is the best case for each of these methods? When should I prefer one over the other, and why?

  • 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-25T19:20:29+00:00Added an answer on May 25, 2026 at 7:20 pm

    It all depends on what you’re trying to do.

    If you want to add elements to a page, and you know how many you need, you can have them on the page and hide/show them when needed.

    If you want to add a dynamic number of new elements, you can just make them on-the-fly, because having them on the page to begin with may not work if you need more than you added.

    You can also clone existing elements, and change their attributes, to add elements to a page.

    This all depends on what you’re trying to do.

    For example:

    1. You have a form that can accept a dynamic number of inputs. You don’t know how many the user wants, so having them on the page to start with (hidden) won’t help. You can either clone the existing inputs (and change their values), or create new ones and add them.
    2. You have a form that allows from 2-5 names to be added. Since there is a fixed amount, you can add 5 inputs, hide 3 of them to begin with, and show them if needed.

    So, there are different methods for what you are trying to do.

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

Sidebar

Related Questions

i've a JavaScript application. I'd like to use a logger but instead of logging
I'm developing a javascript-based application. Using id's to identify elements is often considered a
My Facebook application contains Javascript that works in Firefox and IE, but aborts in
I've got an open source static JavaScript + HTML application that's deployed in about
I've often heard the argument (in javascript, but many languages have an eval-like feature)
Often a user will misuse a Rich Internet Application, and attempt to use the
I want a HTML/javascript application, running in a WebView to make AJAX calls that
I have made an application in javascript using HTML fields in asp.net, as asp
I need a Javascript application that, when run, prompts a password to be entered,
I want to make a JavaScript application that's not open source, and thus 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.