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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T10:20:20+00:00 2026-06-16T10:20:20+00:00

<body> <section id=que-container> <div class=num style=display: none>1000</div> <section id=numberContainer> <span class=number></span> </section> <br class=clear>

  • 0
<body>
    <section id="que-container">
        <div class="num" style="display: none">1000</div>
        <section id="numberContainer">
            <span class="number"></span>
        </section>

        <br class="clear">
    </section>
    <script src="components/jquery/jquery.min.js"></script>
    <script src="components/bootstrap/js/bootstrap-button.js"></script>
    <script src="components/bootstrap/js/bootstrap-carousel.js"></script>
    <script src="js/scripts.js"></script>
    <script>
    $(document).ready(function(){
        var numbers = $('.number');
        var num = $(".num").html();
        var arr = num.split('');

        for (var i = 1; i < arr.length ; i++) {
            $('#numberContainer').append(numbers.clone());
            $('.number').append(arr[i]);
        }

        $('.number').each(function(i, val) {
            $(this).addClass('numStyle');
        })
    });
    </script>
</body>

I am trying to get the values inside the ‘.num’ div, convert it to an array and append the array’s items to the ‘#numberContainer’ within spans with the ‘number’ class. i am not getting any errors on the console but the code doesnt seem to work. any help? thanks

  • 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-16T10:20:21+00:00Added an answer on June 16, 2026 at 10:20 am

    Your code has to be like this because arrays are 0 index based:

    fiddle: http://jsfiddle.net/DZJ6p/

    var numbers = $('.number');
    var num = $(".num").html();
    var arr = num.split('');
    
    for (var i = 0; i < arr.length; i++) {
       $('#numberContainer').append(numbers.clone().append(arr[i]));
    }
    
    $('.number').each(function(i, val) {
       $(this).addClass('numStyle');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iframe container inside the body section and a button. Any click
I have the following HTML code: <ul class=blogEntry> <li class=title section> <span><asp:Literal ID=litTitle runat=server
my body style is like below : * { padding: 0px; margin: 0px; }
I have a set of div pairs (a 'header' and a 'body'). When the
I have a TextBox in my Report's (.rdlc) body section. The size of the
All of the margin settings for the content within the main body section of
How to Get the Content In the Body section of a HTML page in
body{ width:auto; color:white; font-size:15px; width:100%; max-width:1980px; min-width:334px; margin:0px auto; } This is my code.
body{ width:auto; color:white; font-size:15px; width:100%; max-width:1980px; min-width:334px; margin:0px auto; } This is my code.
The body background is not displaying in firefox. here is my CSS body{ font-family:Trebuchet

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.