Blank drop down menu
Blank drop down menu
Hi everyone,
I am rather new to jQuery and php. I would like to make a drop down menu and have read the documentation. I have created a drop down menu
<select id = "animals">
<option value="Mouse">Mouse</option>
<option value="Cat">Cat</option>
<option value="Dog">Dog</option>
</select>
Then I have my script running
var animals = $('#animals').val();
if (animals == "Mouse){
// do stuff
}
However what I would like to do is populate the drop down menu with a blank or white space when the page is first loaded. Then once you open the drop down menu and select cat the blank or white space disappears and is no longer an option. Could someone please help me with this code.
Thankyou