I have this line of html code
$(document).ready(
function() {
$('select[name=tipe_aktiva]').change(
function() {
var newText = $('option:selected', this).text();
$('#tipeLabel').text(newText);
}
);
}
);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<select class="form-control col-md-7 col-xs-12" id="tipe_aktiva" name="tipe_aktiva" required="required">
<option value="">Please Select</option>
<option value="1">AKtiva tetap</option>
<option value="2">AKtiva tidak tetap</option>
</select>
<label style="padding: 8px 0px;" id="tipeLabel" name="tipeLabel"></label>
it worked rfeally well but it change the label with dropdown's text not the value. i wanted to know if it possible to get dropdown's value to change my label. in this case it will be 1 if i choose "Aktiva tetap", and 2 if i choose "Aktiva tidak tetap"
thanks in advance