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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:15:32+00:00 2026-06-04T04:15:32+00:00

HTML : <li>Tue, 15th May 2012 10:11</li> <li>Tue, 15th May 2012 10:12</li> <li>Tue, 15th

  • 0

HTML :

<li>Tue, 15th May 2012 10:11</li>
<li>Tue, 15th May 2012 10:12</li>
<li>Tue, 15th May 2012 10:13</li>
<li>Tue, 15th May 2012 10:14</li>
<li>Tue, 15th May 2012 10:15</li>
<li>Tue, 16th May 2012 21:08</li>
<li>Tue, 16th May 2012 21:07</li>
<li>Tue, 16th May 2012 21:06</li>
<code></code>

jQuery :

$("li").each(function () {
    words = $(this).text().split(' ');
    xxx = words[1]+" "+words[2]+" "+words[3]+",";
    $("code").append(xxx); 
});

I come to this step now, but i dont know how to check duplicates date and append unique date

Demo : http://jsfiddle.net/4kvUy/

  • 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-04T04:15:33+00:00Added an answer on June 4, 2026 at 4:15 am

    Do this way:-

    if ($("code:contains('"+xxx+"')").length == 0)
       $("code").append(xxx);
    

    EDIT:

    To handle Comma, try this way:-

    if ($("code:contains('"+xxx+"')").length == 0){
        if ($("code").text() == '')
            $("code").append(xxx);
        else
            $("code").append(","+xxx);
    }
    

    EDIT2:

    To handle this type of output, try this way:-

    $("li").each(function () {
        words = $(this).text().split(' ');
        xxx = words[1]+" "+words[2]+" "+words[3];
        if ($("code:contains('"+xxx+"')").length == 0){     
            if ($("code").text() == '')         
                $("code").append('["'+xxx);     
            else         
                $("code").append('","'+xxx); 
        }
    });
    $("code").append('"]');
    

    Output:

    ["15th May 2012","16th May 2012"]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my code: <?php $url = http://www.uhasselt.be/collegeroosters/2009_2010_298_5_10.html; $headers = get_headers($url, 1); print_r($headers); $contloc
I'm appending some HTML containing javascript. <td onclick=toggleDay('+data+',this,\'tue\');>T</td> and <img src=img/cross.png onclick=deleteAlarm('+data+');> These two
html code meta tag description, it is generated dynamically and we have quotes in
I am making a calendar using the following HTML code: <!DOCTYPE HTML PUBLIC -//W3C//DTD
I have an input textfield in my html file: <p>From Date: <input type=text id=datepicker></p>
I have the following code that I'm trying to retrieve the HTML document. Not
This code displays times zones vertically. I would like to display them horizontally but
HTML Javascript question to get the selected value of a input-select I can use
Html looks like: <div class=ticker> <div class=news-heading>Latest News:</div> <span class=active_ticker><a href=#> 1] Lorem ipsum
Html can contain little bits of Javascript embedded in it (e.g. defined in onclick

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.