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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:07:09+00:00 2026-06-13T23:07:09+00:00

This may be a strange question. I’m trying to fuse two arrays together, but

  • 0

This may be a strange question. I’m trying to fuse two arrays together, but the read out is showing them as separate types of objects. The first type, gathered by the .serializeArray() jquery function is showing as this when I alert them:

[object Object]

The second, which I am getting from pushing each option in using a more JS way, shows as this:

[object HTMLOptionElement]

Here’s my code below:

   incrCopy();
   enableSubmit();
   disableReset();

   var linkedInArray = [];
   $('form select option.linked-in').each( function() {
   linkedInArray.push(this);
   })
   //These alert the second way

   prevVals = $("form").serializeArray();
   //They alert the first way
   prevVals.push(linkedInArray);
   alert(prevVals);

Anyone have an idea on what I’m missing here?

  • 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-06-13T23:07:10+00:00Added an answer on June 13, 2026 at 11:07 pm

    This is not a difference between jQuery and JavaScript. That is how serializeArray works. It doesn’t return a list of HTML elements, it returns a list of plain-old-objects with name/value properties.

    For example, were it to find something like this:

    <input name="user[eye_color]" value="brown" />
    <input name="user[age]" value="47" />
    

    it would return an array of plain-old-objects, looking something like this:

    [
      {
        name: "user[eye_color]",
        value: "brown"
      },
      {
        name: "user[age]",
        value: 47
      }
    ]
    

    Conversly, your first loop iterates over a jQuery selector, where each element is a native HTMLElement of some kind (HTMLDivElement, HTMLInputElement, HTMLTableElement, etc).

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

Sidebar

Related Questions

This may sound like a strange question, but hopefully there is an answer out
This may sound like a strange question but I am trying to use the
I know this may seem like a strange question, but say I have two
This may be a stupid question, but I'm trying to replicate a customer's OpenLDAP
This may be a strange question, but it has come up in a project
This may sound like a strange question, but i need to redirect all .rar
This may or may not be a programming question, but one or two users
This may be kind of a strange question, but maybe somebody has an idea...
Hi Guys this may seam a bit of a strange question but here goes:
Question may sounds strange but I want to make this question clear. Some people

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.