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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:33:33+00:00 2026-06-13T11:33:33+00:00

Every example I have seen of reordering elements uses ID’s to swap or insert.

  • 0

Every example I have seen of reordering elements uses ID’s to swap or insert. However, I am getting a feed onto my site and don’t have control over whether an ID is used. I am trying to use blogger.com to write articles, feedburner to create the feed, and have it display on my personal website. Here is what I have:

<li>
   <span class="headline">
      <a href="webpage.html">Article Link</a>
   </span>
   <p class="date">8/3/2012</p>
   <div> Brief article intro...</div>
</li>

Here is what I want:

<li>
   <p class="date">8/3/2012</p>
   <span class="headline">
      <a href="webpage.html">Article Link</a>
   </span>
   <div> Brief article intro...</div>
</li>

I understand examples I’ve seen like so:

$("#div2").insertAfter("#div3");
$("#div1").prependTo("#div2");

But I’m not sure how to accomplish this generically or in a loop so that I can swap only classes within a single parent element.

  • 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-13T11:33:34+00:00Added an answer on June 13, 2026 at 11:33 am

    here’s a solution

    $('li').each( function() {
        var $this = $( this );
        $this.prepend( $( '.date', $this ) ) ;
    } );
    

    it detaches the date element and inserts it at the first position in the li

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

Sidebar

Related Questions

Every example I have seen for this uses RowFilter.regexFilter and filters everything else out
I was reading Enumerations in Java, and every example I have come across uses
Every example I see seems to be for recursively getting files in subdirectories uses
Every example I have seen regarding object serialization, includes an all field constructor and
I do not understand why every example I have seen has the schema from
Every code example for submitting a form inside a WebBrowser control I have seen
Every sample that I have seen uses static XML in the xmldataprovider source, which
I have searched and tried every example regarding singleton, public, and global variables in
I have tree like following example, where every leaf is object. [1] |--[2] |
Every example I've seen on how to deploy an MVC application to Windows Azure

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.