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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:39:11+00:00 2026-06-13T10:39:11+00:00

I get a HTML select option, which I generate with PHP. The names of

  • 0

I get a HTML select option, which I generate with PHP. The names of the options are the folders in a directory. Now I need the value in my jQuery script. I just know the commands $('#select :selected').text() or $(#select).val() but both just bring me the current selected option.

The select box with PHP:

<select id="existAlbum" name="existAlbum" size="1">
    <option>SELECT ALBUM</option>
    <?PHP
        foreach ($alledateien as $datei) {

            $dateiinfo = pathinfo($album."/".$datei);
            if ($datei != "." && $datei != ".." && $datei != "background.jpg" && $datei != "loading.gif") {

                echo ('<option>' . $datei . '</option>');
            };
        };
    ?>      
</select>

Is it possible to add all the values in a jQuery Array?
I need to compare the option values with other words.

  • 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-13T10:39:12+00:00Added an answer on June 13, 2026 at 10:39 am
    $(function(){
    
        var optionValues = [];
    
        $('#existAlbum option').each(function(){
            optionValues.push(this.value);
            //or if you want to use the jquery methods on each option:
            //$(this).val()
            //with your current code, you would need $(this).text(), 
            //since youre not adding any values
            //"this" is the current DOM element (<option>)
        });
    
        //do stuff with the optionValues-array here
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

HTML <form name='region_filter' action='/jobseek/search_cv/' method='get'> <select id=id_region class= name=region> <option value= selected=selected>Все</option> <option value=3>Донецк</option>
I'm using jquery(mobile) to generate a select menu which hides/shows columns of an HTML
In Html (which I did not use) it's <select> <option value=B>Bubblegum</option> </select> In (from
HTML Javascript question to get the selected value of a input-select I can use
i have a HTML like this. I need to get the selected value's count
I want to get HTML source of select text in div and alert that.
Is there a way to get HTML contents from TinyMCE editor using jQuery so
How can I get the html of a certain html element which is located
I have a HTML select list, which can have multiple selects: <select id=mySelect name=myList
I have a single item HTML select box on which I'd like to find

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.