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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:56:34+00:00 2026-06-13T17:56:34+00:00

I’m trying to put together a script that will generate markup that jQuery UI

  • 0

I’m trying to put together a script that will generate markup that jQuery UI will accept to make an accordion, like below.

<div id="accordion">
    <h3>2012</h3>
    <div>
        <ul>
        <li><a href="somepage.html?year=2012&month=10">October</a></li>
        <li><a href="somepage.html?year=2012&month=9">September</a></li>
        <li><a href="somepage.html?year=2012&month=8">August</a></li>
        <li><a href="somepage.html?year=2012&month=7">July</a></li>
        <li><a href="somepage.html?year=2012&month=6">June</a></li>
        <li><a href="somepage.html?year=2012&month=5">May</a></li>
        <li><a href="somepage.html?year=2012&month=4">April</a></li>
        <li><a href="somepage.html?year=2012&month=3">March</a></li>
        <li><a href="somepage.html?year=2012&month=2">February</a></li>
        <li><a href="somepage.html?year=2012&month=1">January</a></li>
    </ul>
    </div>
    <h3>2011</h3>
    <div>
        <ul>
        <li><a href="somepage.html?year=2011&month=12>December</a></li>
        <li><a href="somepage.html?year=2011&month=11>November</a></li> 
        <li><a href="somepage.html?year=2011&month=10">October</a></li>
        <li><a href="somepage.html?year=2011&month=9">September</a></li>
        <li><a href="somepage.html?year=2011&month=8">August</a></li>
        <li><a href="somepage.html?year=2011&month=7">July</a></li>
        <li><a href="somepage.html?year=2011&month=6">June</a></li>
        <li><a href="somepage.html?year=2011&month=5">May</a></li>
        <li><a href="somepage.html?year=2011&month=4">April</a></li>
        <li><a href="somepage.html?year=2011&month=3">March</a></li>
        <li><a href="somepage.html?year=2011&month=2">February</a></li>
        <li><a href="somepage.html?year=2011&month=1">January</a></li>
    </ul>
    </div>
</div>

It should output the year and the current and past months all the way back to 2007. In order to create that type of markup, what would I need to do? Pseudo code:

var d = new Date();
var yr = Number(d.getFullYear());
for (var i = 2006, i < yr, i++)
{
  //create a H3, div, and a ul
  var mo = d.getMonth();
  //some other for loop on the month to create the li items
  //how to handle date display names?
}

Dates in jQuery/Javascript have always been an Achilles heel of mine.

  • 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-13T17:56:35+00:00Added an answer on June 13, 2026 at 5:56 pm

    is this what you want?? try DEMO : answer demo if yes, so you have to learn more to improve your logic 🙂 try to learn how jquery append() , accommodate to temporary variable, and the pattern of html

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I am trying to understand how to use SyndicationItem to display feed which 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.