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 Answer