javascript - how to hide form option with jquery -



javascript - how to hide form option with jquery -

i have html form:

<select id="selection" name="type"> <option value="interior">interior</option> <option value="music">music</option> </select> <select id="whichvideo" name="vidtype"> <option value="">choose video type</option> <option value="youtube">youtube</option> <option value="vimeo">vimeo</option> <option id="soundcloud1" value="soundcloud">soundcloud</option> </select>

and jquery:

$("#selection").change(function () { if ($(this).find("option:selected").val() === "music") { $("#soundcloud1").show(); } else { $("#soundcloud1").hide(); } });

with fiddle

why when select music , homecoming interior in form. not hide alternative soundcloud

this working fine me in firefox 30.

working fiddle

i have added jquery library in fiddle. allow me know if looking else.

javascript jquery html

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -