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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:23:13+00:00 2026-06-10T07:23:13+00:00

I have these tags in my HTML, <div id=main> <div id=options></div> <div id=searchField></div> <div

  • 0

I have these tags in my HTML,

<div id="main">
    <div id="options"></div>
    <div id="searchField"></div>
    <div id="options"></div>

    <div id="results">
        ***<!-- I want to add elements here -->***
        <div id="pagenumber">
        <div id="footer">
    </div>
</div>

What would be the javascript code that appends children above id="pagenumber" and inside id="results"?

  • 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-10T07:23:15+00:00Added an answer on June 10, 2026 at 7:23 am

    You could use the following approach:

    var pagenumber = document.getElementById('pagenumber'),
        results = document.getElementById('results'),
        newElem = document.createElement('div');
    
    results.insertBefore(newElem, pagenumber);
    

    To insert after the pagenumber node you could use:

    results.insertBefore(newElem, pagenumber.nextSibling);
    

    References:

    • node.insertBefore().
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have these lines drawn to connect these div tags here: http://sandbox.brightboxstudios.com/orgmap/index2.html However
I have the following HTML: <div class=menu> <a class=main-nav-item href=home>home</a> <a class=main-nav-item-current href=business>business</a> <a
I have created the layout for my new portfolio webpage here: http://vitaminjdesign.com/work.html I want
Possible Duplicate: special characters in id of html tags I have a DIV with
If I have the following html: <body> <div id=mainTop> </div> <div id=main> <h2> <%=
In my page I have many DIV and P tags, and I want to
I have some models; Vocabularies (tags lists), Labels (tags) and different articles types. These
I have these three lists with the same number of elements List<String>competitoinsIDs = new
At the moment, I have a base HTML template file. When ever I want
I have a container and inside that I have several anchor tags. These anchor

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.