<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.
.change()handler to the select, and put yourifinside the handler?<center>tag in favor of CSS positioning ondiv.main. Also, try<br />rather than</br>.div.harga? Because attempting to manipulate the.valueproperty is not gonna work, becausevalueisn't a property of the jQuery object you return in your script. You could use.text(), or else.harganeeds to belong to an form element of some sort. And if you meant to have that be an input element, then you need to either use jQuery's.val()method to set it, or get that specific DOM node from the jQuery object, which then has avalueproperty.