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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:52:08+00:00 2026-05-26T02:52:08+00:00

I am wanting to run a jquery.append function on some divs. Basically, I am

  • 0

I am wanting to run a jquery.append function on some divs. Basically, I am calling information to the database, and the database knows which DIV id the content belongs to, so I want the DIV id in the .append function to be different for each value.

I guess I want to know how I can run a loop on the Jquery portion. Everything else I am doing is working great!

  • 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-26T02:52:09+00:00Added an answer on May 26, 2026 at 2:52 am

    Lets say your each id is stored into an array in PHP, i.e.

    <?php
    $all_ids = Array(
      '1' => 'ID 1 value',
      '2' => 'ID 2 value',
      '3' => 'ID 3 value'
    );
    ?>
    

    You can use json_encode to translate the array to a javascript object.

    <script>
    var iterateMe = <?=json_encode($all_ids)?>;
    $.each(iterateMe,function(index, value) {
      // This is where you would run each append
      alert(index + ": " + value);
    });
    </script>
    

    Then, iterate as normal!

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

Sidebar

Related Questions

Lately, I've often found myself wanting to run some command on the output of
I am currently wanting to run a SQL statement that will filter my database
I frequently find myself wanting to efficiently run a Clojure function multiple times with
I'm wanting to extract data from a mySQL database which shows the members with
Wanting to implement authentication by client certificates I am experiencing some issues. First some
So I'm trying to understand this whole AJAX/jQuery thing. Right now, when I run
I am currently working on some prototypes for a web site I am wanting
I don't understand what this code is doing, I'm wanting to run a command
Trying to run the basic examples given by playn, wanting to have a go
I have some HTML that is being run through PHP: <a href=?char=>&</a> and I'm

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.