use js to get select value
// reference to 'scripts' select list
// used throughout the examples below
var sel = document.getElementById('scripts');
// display value property of select list (from selected option)
console.log( sel.value );
use js to get select value
// reference to 'scripts' select list
// used throughout the examples below
var sel = document.getElementById('scripts');
// display value property of select list (from selected option)
console.log( sel.value );
get value from select tag
<form>
Select your favorite fruit:
<select id="mySelect">
<option value="apple">Apple</option>
<option value="orange">Orange</option>
<option value="pineapple">Pineapple</option>
<option value="banana">Banana</option>
</select>
</form>
<script>
function myFunction() {
var x = document.getElementById("mySelect").value;
console.log(x);
}
</script>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us