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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:49:06+00:00 2026-05-27T20:49:06+00:00

Given this element: <div class=box id=trololo> <h2 class=header gradient-red></h2> <div class=body> <div class=queue> <ul

  • 0

Given this element:

<div class="box" id="trololo">
     <h2 class="header gradient-red"></h2>
     <div class="body">
          <div class="queue">
               <ul class="queue-list">

               </ul>
          </div>
          <div class="time">

          </div>
     </div>
</div>

Which is a skeleton, I would like to insert it in the DOM, hidden and animate it’s entry. I really love this way, because it’s elegant:

jQuery('</div>',{
    id: 'trololo',
    class: 'box'
}).hide().appendTo('#anotherDiv').fadeIn('slow');

But, how could I chain multiple elements like this?

I’ve thought about adding the whole html in the html property but doesn’t sound fine for me.

  • 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-27T20:49:07+00:00Added an answer on May 27, 2026 at 8:49 pm

    Live Example

    $("<div>", {
        className: 'box',
        id: 'trololo'
    }).append(
        $('<h2>', {
            className: 'header gradient-red'
        }),
        $('<div>', {
            className: 'body'  
        }).append(
            $('<div>', {
                className: 'queue' 
            }).append(
                $('<ul>', {
                    className: 'queue-list',
                    textContent: 'dummy-text' 
                })  
            ),
            $('<div>', { 
                className: 'time' 
            }) 
        )
    ).hide().appendTo('#anotherDiv').fadeIn('slow');
    

    Whether this is the ‘readability’ you were looking for is for you to decide.

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

Sidebar

Related Questions

Normally I would create an element in jQuery like this $('<div id=errors class=red></div>') Can
How do I get a tuple/list element given a condition in python? This occurs
I'm trying to select an element given by: /html/body[@id='someid']/form[@id='formid']/div[@id='someid2']/div[@id='']/div[@id='']/div[@id='']/table/tbody[@id='tableid']/tr[7]/td[2] Now the html of that
Given: require 'rubygems' require 'nokogiri' value = Nokogiri::HTML.parse(<<-HTML_END) <html> <body> <p id='para-1'>A</p> <div class='block'
Given this last thread: Javascript/Jquery: Show a hidden div based on a Radio box
Given this structure: <div class=a> <div class=b> </div> </div> <div class=c></div> <div class=d></div> ...And
Given this class class Foo { // Want to find _bar with reflection [SomeAttribute]
Given this example: <img class=a /> <img /> <img class=a /> <img class=a id=active
I have got ul-li list in which there is a span element inside all
for the following html <div> <div class=col1 > I dont want to select this

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.