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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:13:49+00:00 2026-05-17T17:13:49+00:00

<div> <div class=one>One</div> <div class=two>Two</div> <div class=three>Three</div> <div class=four>Four</div> <div class=five>Five</div> </div> I need

  • 0
<div>
  <div class="one">One</div>
  <div class="two">Two</div>
  <div class="three">Three</div>
  <div class="four">Four</div>
  <div class="five">Five</div>
</div>

I need to add a div between div Three and Four, but I can’t use any sort of targeting on the parent div (only the divs inside it).

jQuery('.four').parent().prepend('<div class="addme">Add Me!</div>');

This as you probably know adds it to the top, above div One. Without the “.parent()” it adds the div inside of div Four, before the content. Same difference for “.append()”.

Anyone got a solution?

  • 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-17T17:13:50+00:00Added an answer on May 17, 2026 at 5:13 pm

    You can use .before() or .after() like this:

    jQuery('.four').before('<div class="addme">Add Me!</div>');
    //or...
    jQuery('.three').after('<div class="addme">Add Me!</div>');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my HTML <div class=one>...</div> <div class=two>...</div> <div class=three>...</div> <div class=four>...</div> <div class=five>...</div>
I want to find a <td role=foo class=one two three four> within a <div
I have a set of divs eg: <div class=wrapper> <div class=uct_attr data-tags=one two three
What happens when an element has multiple class attributes? <div id=test class=one two three
Consider the following HTML: <div class='x'> <ul> <li>Number one</li> <li>Number two</li> <li>Number three</li> <li>Number
<div class=test-test-one>one</div> <input type=checkbox class=now name=here_one> <br /> <div class=test-test-two>two</div> <input type=checkbox class=now name=here_two>
Alright, let's say that I have the following markup: <div class=ticker> <p>News Item One.
This is what I am trying to do : HTML <div class=container> <div id=one
I've just wrote the code below to add a class to the outer div
I have a div class named switch control which has a div class named

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.