Reputation: 41
<center>
<div class="main">
<div class="harga">Rp.2,680,000 / Bln</div>
<div class="other">Kontrak Setahun
atau <label>Rp. 2,930,000 / Bln</label></div>
</br>
<div class="traffic">Pilih traffic Anda dibawah ini</div>
<select class="visitor">
<option value="5,000">Up To 5,000</option>
<option value="7,900">Up To 7,900</option>
<option value="17,600">Up To 17,600</option>
<option value="25,000">Up To 25,000</option>
</select>
</br>
Visitor / Bulan
</div>
</center>
<script type="text/javascript">
$(function() {
if((".visitor").val() == "5,000") {
$(".harga").value == "4000";
}
});
</script>
i have this script, how can I change the value on harga from visitor, when I choose selection from select box?
thank you before.
Upvotes: 3
Views: 64
Reputation: 1336
Use change
event like this
$('.visitor').change(function(){
if($(this).val() == '5,000'){
// write your to do action here
}
});
Upvotes: 1