This code is displaying the dropdown value in textbox on selection. But i want to display my own values in textbox instead of those default values(Default values of dropdown). how could i do that thing . I have a text box with id "#amount".
This is HTML code:
<select id="d-name" class="form-control" name="menu">
<option value="Left Chest">Left Chest</option>
<option value="Simple back">Simple back</option>
<option value="Complex back">Complex back</option>
</select>
<input type="text" id="amount" />
This is javascript code:
jQuery('#d-name').change(function(e){
var selectedValue = jQuery(this).val();
jQuery("#amount").val(selectedValue);
});