Hello! Im trying to see if a special option in a select-menu has a value equal to 1, and then hide another object. Ive been trying all day but cant figure it out (probably because im a total beginner at jquery)
I have a select-menu that i populated from a db. If the option with the id="1" have "selected=selected" then i want another div to hide when the page is loaded.
This is what i got so far:
<select>
<option id="3">test1</option>
<option id="1" selected="selected">test2</option>
<option id="2">test3</option>
</select>
<div id="hide">Hide me</div>
$("#1 option:selected").ready(function () {
$("#hide").hide();
});
Any help would be greatly appreciated. Thanks.. /Andreas