I have this code:
JS
var a = document.getElementById("quantity");
var quantity = a.value;
HTML
<select id="quantity" name=''>
<option title='Option 2' value='2 people'>2 people</option>
<option title='Option 3' value='3 people'>3 people</option>
<option title='Option 4' value='4 people'>4 people</option>
<option title='Option 3' value='5 people'>5 people</option>
<option title='Option 4' value='6 people'>6 people</option>
</select>
I can't change the HTML only the JS. How do I get it to output the first char, so what I am actually getting out is a number (either 2,3,4,5 or 6).
I tried this but it broke the script:
var a = document.getElementById("quantity");
var quantity = a.substring(0,1);