javascript - Put an option value in a input text -
i'm trying put option value of select in input text have this:
<select name="typers" id="contact-location" class="form-control"> <option value="facebook">facebook</option> <option value="twitter">twitter</option> <option value="google +">google +</option> <option value="autres">autre</option> </select>
and when submit, want input text value of option selected :
<input type="text" name="typers" value="myselectedoption"/>
i have tried without success... know how ?
you can use:
$('input[name=typers]').val($('#contact-location').val());
Comments
Post a Comment