I have this piece of code for select option:
<select class="select-box" name="select-choice-month" id="select-locations">
<option id="1">Select Region</option>
<option id="2" value="eu">Europe</option>
<option id="3" value="nam">North America</option>
<option id="4" value="sam">Latin America</option>
<option id="5" value="aspa">Asia/Pacific</option>
</select>
On select change I already have to change its background like this (displaying or hiding specific div):
$('#select-locations').change(function() {
$('#form1, #form2, #form3, #form4, #form5').hide();
$('#form' + $(this).find('option:selected').attr('id')).show();
});
But, now I have mini navigation which is also displaying or hiding same div's
<div id="map-menu">
<a href="#" id="3">North America</a>
<a href="#" id="4">Latin America</a>
<a href="#" id="5">Asia/Pacific</a>
</div><!-- end of map-menu -->
Jquery for this:
$('#map-menu a').click(function() {
$('#form1, #form2, #form3, #form4, #form5').hide();
$('#form' + $(this).attr('id')).show();
});
How can I achieve when anchor is clicked and div is changed to change output (name) of selected option also? In first example that is working, but when I am changing it through anchors it doesnt work ...
Tnx for any answers