I am new to javascript and jquery. I was writing an application, in which user an option to choose his state from dropdown of 50 US states and after selecting a state he gets the respected counties dynamically in the dropdown as well. Suppose I want to dynamically insert a text box for people who donot belong to those 50 states and counties and want to enter their own state and county how can I do it using jquery/javascript? ( For example : If state not applicable please select “other” and enter your state and county)
Share
Given the following:
And the jQuery:
JS Fiddle demo.
This should be enough to get you started, I think.
References:
change().val().attr().insertAfter().