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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:22:00+00:00 2026-06-15T14:22:00+00:00

jQuery(‘#additional-channels-list select’).live(‘change’, function(){ var current_id = parseInt(jQuery(this).val()); select_values.push(current_id); console.log(select_values); console.log(jQuery.inArray(current_id, select_values)); }); I want

  • 0
jQuery('#additional-channels-list select').live('change', function(){
    var current_id = parseInt(jQuery(this).val());
    select_values.push(current_id);
    console.log(select_values);
    console.log(jQuery.inArray(current_id, select_values));
});

I want to create multiple select without ctrl, so i need to store values in array. When i trying to check values inArray method returns to me the position of selected element in select list instead of information about current value in array. Where i am wrong?

  • 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-15T14:22:02+00:00Added an answer on June 15, 2026 at 2:22 pm

    InArray returns item index, as from jQuery documentation:

    The $.inArray() method is similar to JavaScript’s native .indexOf()
    method in that it returns -1 when it doesn’t find a match. If the
    first element within the array matches value, $.inArray() returns 0.

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

Sidebar

Related Questions

jQuery(document).ready(function($) { $('input[type="text"]').live('focus', function() { if (this.value == 'someValue') { this.select(); } }); });
JQUERY <script type=text/javascript src=jquery-1.5.1.min.js></script> <script type=text/javascript> $('#aggiungi').live('click', function(){ var thisRow = $(this).parent().parent(); // clone
Jquery did not carry out!!!I don't know why $(.other-edithion).click(function(){ var city = $(this).closest('#city'); if
jQuery(document).ready(function($) { var devices = $(.menu-item-custom).map(function() { return this.id.substr(10); }).toArray(); $.each(devices, function() { $(#menu-item-settings-+this+
jQuery(function ($) { $('input.adud').on('click', function() { var thisdiv = $(this).parents('div').attr(id); var thisform = $(this).parents('form').attr(id);
jQuery('td[class=bgoff]').each(function() { var td = jQuery(this); ... no apply selector to this only });
jquery looks like this $.post('JSP/processForm.jsp', $(#Form).serialize(), function(data){ //I want to iterate through every line
jQuery.widget(ui.test,{ _init: function(){ $(this.element).click(this.showPoint); }, showPoint: function(E){ E.stopPropagation(); alert(this.options.dir); } } $('#someEleme').test(); Right now,
jQuery $('a.popup').click(function(){ window.open( this.href, 'Page title', 'width=600, height=650' ); return false; }); HTML <a
jQuery(document).ready(function() { var firstv=10; var secondv=20; var thirdv=70; var name1=ram; var name2=kumar; var name3=manju;

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.