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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:29:53+00:00 2026-06-18T03:29:53+00:00

According to docs https://developer.mozilla.org/en-US/docs/DOM/Node.appendChild , appendChild adds a node to the end of the

  • 0

According to docs https://developer.mozilla.org/en-US/docs/DOM/Node.appendChild, appendChild adds a node to the end of the list of children of a specified parent node.

However, my example shows it adds the child to the top of the list of children.

How is that? Any idea why it happens against the docs?

According to docs, these code should add a new div element to the end of targetArea node, instead, it adds to the top of the node.

var targetArea = document.getElementById('nav');
var div = document.createElement('div');
var snippet = document.createTextNode('this is a new DIV');
div.appendChild(snippet);
targetArea.appendChild(div);

My code online:
http://jsfiddle.net/dennisboys/BRtYb/6/

  • 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-18T03:29:54+00:00Added an answer on June 18, 2026 at 3:29 am

    It seems because you put <div> in <p> and the <div> will close the <p>.

    Also see this question. Putting <div> inside <p> is adding an extra <p>

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

Sidebar

Related Questions

According to MDN ( https://developer.mozilla.org/en-US/docs/DOM/CSSStyleRule ) The CSSStyleRule object's style property is read-only. Is
Is the information in this link accurate? https://developer.mozilla.org/en-US/docs/DOM/Selection According to this document: anchorOffset: Returns
According to this page https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Reserved_Words You can't use these reserved words as variables, but
I've been following the lessons about transparency and gradients on the Mozilla site: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Canvas_tutorial/Applying_styles_and_colors
According to to the SCM Activity plugin info from the Sonar Webiste ( http://docs.codehaus.org/display/SONAR/SCM+Activity+Plugin
According to https://developers.google.com/appengine/docs/python/config/cron cron jobs can run for 10 minutes. However, when I try
According to this article: http://subsonicproject.com/docs/3.0_Migrations Bottom line: if you're a developer that is concerned
According to YouTube's docs: https://developers.google.com/youtube/2.0/developers_guide_protocol_playlists I can go to the following URL to retrieve
According to documentation ( https://developers.google.com/closure/compiler/docs/api-tutorial3#externs ), it seems the closure compiler should rename variables
According to https://developers.facebook.com/docs/beta/authentication/ , the 'Default Activity Privacy' field in the Auth Dialogue can

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.