Gökhan Geyik Gökhan Geyik - 7 months ago 11
Javascript Question

Select Option Javascript

I have a project about Language School Website. It has lots of dealers.

If users select dealers, then click about us, I want redirect to about us page of SELECTED dealers.

How can I solve this problem using jQuery?

Thank you

<div class="blueBox">
<h2 class="title">Dealers</h2>
<span class="sortArea clearfix">
<a href="#" class="blueBt Bt">All Dealers</a>
<!--scroll dropdown-->
<form >
<select id="e1">
<option value="Education Center">Education Center</option>
<option value="Yenimahalle">Yenimahalle</option>
<option value="Demetevler">Demetevler</option>
</select>
</form>
<!--scroll dropdown-->
</span>
<div class="detail clearfix">
<h3 class="subTitle">Şube Seçiniz</h3>
<ul class="detailLinks">
<li><a class="one Bt" href="#">About US</a></li>
<li><a class="two Bt" href="#">Pictures</a></li>
<li><a class="three Bt" href="#">Personal</a></li>
<li><a class="four Bt" href="#">Contact Us</a></li>
</ul>
</div>
</div>

Answer
$("#aboutUsLink").click(function(){
  selected = $("option:selected","#e1").attr("value");
  window.location.href = aboutPage(selected);
})

http://api.jquery.com/selected-selector/

Comments