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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:52:49+00:00 2026-06-02T08:52:49+00:00

I have a content (#content) at external file (test.html) to load into another DIV

  • 0

I have a content (#content) at external file (test.html) to load into another DIV (#result) at index.html:

test.html:

<div id="content">This text should not be loaded with its DIV. <strong> May contain other tags</strong></div>

jquery:

$('#result').load('test.html #content');

index.html result, unexpected:

<div id="result"><div id="content">This text should not be loaded with its DIV. <strong> May contain other tags</strong></div></div>

index.html result, expected:

<div id="result">This text should not be loaded with its DIV. <strong> May contain other tags</strong></div>

How do you load only the actual content/ HTML of the #content which may also contain other tags, but only without its wrapper DIV (#content)?
The reason is to simply avoid unneeded divities which also may conflict with other styled DIVs by mistake.

Any hint is very much appreciated. 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-02T08:52:50+00:00Added an answer on June 2, 2026 at 8:52 am

    Here’s a thought. What if you use a temporary tag as a workspace?

    This jQuery javascript…

    $('#workarea').load('test.html #content');
    

    … might produce this result. Notice that the workarea is hidden:

    <div id="result"></div>
    <div id="workarea" style="display: none"><div id="content>This text should not be loaded with its DIV</div></div>
    

    Then, you could move it to the result with this…

    $('#result').html($('#workarea').html());
    

    It should produce this result.

    <div id="result">This text should not be loaded with its DIV</div>
    <div id="workarea" style="display: none"><div id="content></div></div>
    

    Edit:

    Here’s the complete script all in one place:

    $('#workarea').load('test.html #content');
    $('#result').html($('#workarea').html());
    

    You would use these two lines instead of your one line. If I understand correctly, it should produce the expected result in the query above.

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

Sidebar

Related Questions

I have a index.php file that will include several external files: content/templates/id1/template.php content/templates/id2/template.php content/templates/id3/template.php
can we have content text directly in <div>text content</div> or it should be like
I have this JQuery function: function addSomeHTML() { $(#mysection).html(<div id='myid'>some content here</div>); } I
I have a page (main.php) which loads content from an external PHP file (rpc.php).
I have this function correctly linked in an external .js file... function SubmitAge(age, UpdatePanelID,
I have an xml file <xml> <head> <title>Test</title> </head> <body> <para> This is a
I have a portal application that loads external content (widgets) via an iframe. Users
I have several images stored in content://media/external/images/media. I would like to display by using
I have a menu that if you click it it loads external content then
I have some content sliding here. http://www.smallsharptools.com/downloads/jQuery/Slider/slider.html The HTML structure is simple. There is

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.