Brad Brad - 1 year ago 97
CSS Question

Toggle visibility of a form element

I'm trying to toggle the visibility of a form element using jQuery. I have a flipswitch widget and am setting it's class with either the

attributes, as can be seen in this fiddle. The problem is that it's working in the fiddle, but not in my code. My code hides the
field but not the
field. I'm finding it hard to debug as jQuery adds
style="display: none;
to the
element but leaves the
element (and it's styles) unchanged. Any ideas?

Answer Source

I couldn't seem to solve this problem, but wrapping the element in another <div> and then hiding that new <div> solved the problem.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download