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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:07:37+00:00 2026-05-23T00:07:37+00:00

Rewriting an html element’s content, or itself is easy via jquery, but is it

  • 0

Rewriting an html element’s content, or itself is easy via jquery, but is it possible to replace an element with an element that exists on another page/file? My point is that i don’t want this info that i’m trying to retrieve to be on the page by default as it would clog up the file and bloat the file size…

To provide context: I have an unordered list in my html. Say it’s a grocery list. I have some option that changes the list to a bill of materials instead. So it replaces the ul with the ul (and it’s li children) with this new set, of which is located in an external html file. (that file being just an ul and li’s.) I want this external/retrieval because these lists could be quite long, and i need the lists to be DOM elements because i need to work with them via other scripts, etc.

Regex on a text file that’s been prepared for this operation isn’t a perfect solution either, since these li’s will have a/> tags within, and there’s a variety of classes across the li’s as well…

I pretty much want to append an html file to the DOM, i suppose.

  • 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-23T00:07:38+00:00Added an answer on May 23, 2026 at 12:07 am

    Try this:

    jQuery.get('myFile.html', function(data) {
      jQuery('#myElement').html(data);
    });
    

    Or to replace the element itselft:

    jQuery.get('myFile.html', function(data) {
      jQuery('#myElement').replaceWith(data);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i know this is incredibly easy but I have been writing and rewriting this
I typically use URL rewriting to pass content IDs to my website, so this
I'm rewriting a PHP+MySQL site that averages 40-50 hits a day using Django. Is
I am rewriting a project so that it uses getters and setters to reference
I am scraping a website with HTML with php that retrieves a page and
I display receipt in both HTML and printer-friendly version. HTML version does jQuery tabs,
Basically I have a joomla instance with an article that uses URL rewriting. http://example.com/kids-and-family/185-summer-camp.html
I'm using URL Rewriting under ASP.NET 4 (using ISAPI_Rewrite) and I'm finding that that
I would like to use RewriteRules in .htaccess to achieve particular url rewriting, but
I'm in the process of rewriting all the URLs on my site that end

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.