我的代码有问题,当我点击选项并刷新浏览器将返回默认选项
HTML
<select id="harga">
<option value="renceng" isi="10" selected>Renceng</option>
<option value="pack" isi="40">Pack</option>
<option value="dus" isi="800">Dus</option>
</select>
<input id="hasil" type="text" name="harga" placeholder="isi" value="10" readonly>
JS
$("#harga").on("change", function(){
var nilai = $("#harga :selected").attr("isi");
$("#hasil").val(nilai);
});