Hey there am having problem implenting the function that enables one to show and hide a form element

I have a registration form on my site, when the dropdown for state is selected I want a hidden dropdown of surbubs and a text field for address to become visible

The dropdown for surbubs should hold different content depending on the state selected

Wouldn't mind a sample code