<select id="milesAway">
<option id="5" value="5">5 miles</option>
<option id="10" value="10">10 miles</option>
<option id="25" value="25">25 miles</option>
<option id="50 value="50">50 miles</option>
<option id="100" value="100">100 miles</option>
<option id="250" value="250">250 miles</option>
<option id="500" value="500">500 miles</option>
</select>
<input type="text" id="zipCode" />
<input type="text" id="cityState" class="cityState" />
So at any point in time, only one of these 3 available inputs will be shown. They are all controlled by .show()
and .hide()
I do I use JQuery to find out which one is the one that is shown and get it's id.
Thanks!
you can do
$(':input:visible') //This will selects all inputs on the page. You can narrow this down by specifying an ID that wraps the input you are looking or.
You can also check if input is visible by doing
$('#cityState').is(':visible')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With