[jQuery] Re: hiding a using html select (drop down)

2008-12-23 Thread Ricardo Tomasi
It's doing exactly what your code asks it to do, which is to toggle the visibility of #divarea every time you click the dropdown. What you want is $('#dropdown').change(function(){ $('#divarea')[ ($(this).val() == 'double') ? 'hide' : 'show' ]() }); equivalent to $('#dropdown').change(funct

[jQuery] Re: hiding a using html select (drop down)

2008-12-23 Thread ben.hollis
Try using "change" instead of "click". -Ben On Dec 22, 8:44 pm, "Louie Miranda" wrote: > I tried to hide the using the toggle() function below. > > javascript code > > > > > $(document).ready(function() { > > >         $("#dropdown").click(function() { > >         $("#divarea").toggle(); > >