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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:05:08+00:00 2026-05-17T18:05:08+00:00

Not sure how to use javascript or jquery to make my divs populate with

  • 0

Not sure how to use javascript or jquery to make my divs populate with accordian style headings and content.

<html>
<head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="js/jquery-ui-1.8.2.custom.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    $("#accordion").accordion(
        autoheight: false);
    });

/**       Variable

   *       variableID:String - unique string identifier for the variable
   *       name:String - plain text name
   *       description:String - description of the variable and its meaning
   *       value:Integer - current number-based value of the variable
   *       locked:Boolean - whether the variable is locked against further modification
*/       
    function loadVariables(variables) {
        if (typeof variables != "object") { alert(variables); return;}
    for (var i = 0; i < variables.length - 1; i++) {
/*  make name= <h3><a href="#">name</a></h3>
    make variableID, description, value=
    <div>
    <p>"Variable ID : " + variableID</br>
    "Description : " +description</br>
    "Initial Value : " +value</br>
    </p>
    <p>"History"</br>
    A container for updateVariable function.
    </p>*/
    }
    };

    function updateVariable(variable) {
    // make update Variable in the History box as variable values change
    // change background color and change locked icon status
    };
    </script>


</head>
<body>
<div id="accordion">
<!--- Divs Created Dynamically here ---->
</div>

</body>
</html>
  • 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-17T18:05:08+00:00Added an answer on May 17, 2026 at 6:05 pm
    // Inside the for loop, do this:
    // This is the <h3> jQuery object you'll be inserting. I'm chaining the creation.
    var h3 = $('<h3>').append($('<a>').attr('href', '#').text('name'))
    $('#accordion').append(h3)
    // This is the <div> object to be inserted into the accordion.
    var div = $('<div>').append($('p').html('html inside first <p>'));
    div = div.append($('p').html('html for history'))
    $('#accordion').append(div)
    

    The key here is that you can add things to the DOM with $(parent).append($('<tag-name>')). $('<tag-name>') will create a new jQuery object of that tag that is just floating. The .append(obj) method will attach the obj at the end of the parent that is calling it. So $('#accordion').append($('<h3>')) will append an open and close h3 tag at the end of #accordion.

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

Sidebar

Related Questions

I've found ScriptingJsonSerializationSection but I'm not sure how to use it. I could write
Not sure this is a programming question, but we use LaTeX for all our
I am not sure when I should use anonymous types instead of local variables
I am not sure, whether I should use for -loop. Perhaps, like for i
I would like to use VB9 but am not sure what syntax to use
I need to use DbTransactions (on a single db) but I am not sure
I am looking to use quartz to schedule emails, but I'm not sure which
I know how to use Perl's Getopt::Long, but I'm not sure how I can
I am implementing COM Add-In for Outlook. I use IDTExtensibility2. I am not sure
Not sure if this is possible or if I'm expressing correctly what I'm looking

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.