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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:06:05+00:00 2026-05-30T07:06:05+00:00

How to output a particular JQuery array into a particular Div. For example I

  • 0

How to output a particular JQuery array into a particular Div. For example I want to pull the (phrases[0]) array into Div id=”div01″, and the (phrases[1]) array into Div id=”div02″. I have read up all the functions of JQuery but can’t find this.

var phrases = [
['nihao', 'orange', '你 好', 'hello'],
['zaijian', 'red', '你 好', 'goodbye']
];

makePhrase = function(phrase){
var div = $('<div class="word"><span class="pinyin">' +phrase[0]+ '</span><br/><span class="chinese">'     +phrase[2]+ '</span><br/><span class="english">' +phrase[3]+ '</span> </div>');

And then I need a line to say (in effect):

.append makePhrase( phrases[0] ) to Div id=”div01″

but do not know the correct method. This is only my second day of learning JQuery so I would appreciate a spell-it-out answer which then I can learn more from through further investigation! I hate being the noob but any help would be appreciated.

  • 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-30T07:06:06+00:00Added an answer on May 30, 2026 at 7:06 am

    You are very close; Try this:

    var phrases = [
        ['nihao', 'orange', '你 好', 'hello'],
        ['zaijian', 'red', '你 好', 'goodbye']
        ];
    
    makePhrase = function(phrase) {
        var div = '<div class="word"><span class="chinese">Chinese: ' + phrase[0] + '</span><br/><span class="pinyin">Pinyin:' + phrase[2] + '</span><br/><span class="english">English: ' + phrase[3] + '</span> </div>';
        return div;
    }
    
    $("#div01").append(makePhrase(phrases[0]));
    $("#div02").append(makePhrase(phrases[1]));​
    

    And proof it works over at jsfiddle: http://jsfiddle.net/SKssF/14

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

Sidebar

Related Questions

I have a situation where particular elements (xs:simpleType, xs:complexType) are placed in the output
I have a output file which is a two dimensional array (this file was
I want to keep an eye on the output of a particular command, say
On all my template rendering for a particular app, the output ends with None
My project need to compare output(only urls) of google and yahoo for a particular
Is there any way to find particular C language function's input and output parameters
The output of my JSON call can either be an Array or a Hash.
The output of eg >>w = whos; returns an array of structs. I would
I have five html pages ,all pages have same search tab,header,footer, my question is
Here is a particular scenario that I have been unclear about (in terms of

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.