こんにちは私は、顧客がドロップダウンから選択したアカウントのタイプに基づいて金利値を変更する方法についてのガイダンスを探しています。
形:
<form id="account" action="" method="post">
<select id = "acc_type">
<option value="current">Current</option>
<option value="savings">Savings</option>
</select>
<input type="text" id="interest" value="">
</form>
<script>
$("#account").change(function() {
var rate = "0.6%";
if $(#acc_type).val == ("current") {
rate = "0.6%");
} else if $(#acc_type).val == ("savings") {
rate = "0.8%");
}
$(#interest).val = rate;
</script>
http://jsfiddle.net/rmjKV/ なぜこれが機能しないのか説明してもらえますか?