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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:46:36+00:00 2026-05-24T18:46:36+00:00

I have an array of DIV elements in an array called ‘noactiveMsg’. I want

  • 0

I have an array of DIV elements in an array called ‘noactiveMsg’.
I want to load these DIV elements into a DIV called $('#chatCenterMembers').

I’ve tried:

noactiveMsg.appendTo($('#chatCenterMembers'));

But this doesn’t work.
Can someone advice on the syntax to load an array of elements/objects into a div?

code to made the array:

var noactiveMsg=[];
 $('div.chatmember').each(function() {                        
 if($(this).children().children('div').hasClass('chatactivestatus_offline')) {
 alert('offline');
 noactiveMsg.push($(this));
 }              
 });
  • 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-24T18:46:38+00:00Added an answer on May 24, 2026 at 6:46 pm

    If each element of your array is a jQuery object, you can try this:


    Some sample html:

    <div>
        <p>Some stuff below!</p>
    </div>
    

    The jQuery stuff:

    $(function(){
        var foo = [];
        foo.push( $('<p>hello</p>') );
        foo.push( $('<p>world</p>') );
        foo.push( $('<p>Adam</p>') );
    
        // this will fail because each element is a 
        // separate jQuery object
        // $('div').append( foo );
    
        // instead try this
        $.each(foo, function(){
            $('div').append(this);
        })
    });
    

    see it work on jsFiddle

    I also answered a similar question just recently

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

Sidebar

Related Questions

I have two DIV-elements, which are assigned an array called stack using data() .
VISUAL C++ Question Hi, I have array of 3 elements and I want to
I have a list of div elements: var list = $('.divelement').get(); I want to
I have a few div elements that i want to dynamically apply an effect
I have four DIV elements on my page. Each has it's own array which
An array is defined of assumed elements like I have array like String[] strArray
I have few nested DIV elements. For example: <div id='id1'><div id='id2'>content</div></div> I attach event
document.getElementsByTagName('div') returns an array of elements. document.getElementsByTagName('div')[0] returns a single element. but for some
I have a div with elements below it that I am serializing. I am
I have a function that gets an array of DOM elements (based on tags)

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.