I want to make script which display text when somebody choose option from select. I was trying this script but it's wasn't work.
<select name="inputDrugForm">
<option id="one">Tabletki</option>
<option id="two">Syrop</option>
<option id="one">Saszetki</option>
<option id="two">Spray</option>
<option id="one">Inny</option>
</select><br>
<div id="content"></div>
<script type="text/javascript">
var b1 = document.getElementById('one'),
b2 = document.getElementById('two'),
content = document.getElementById('content');
b1.onselect = function() {
content.innerHTML = 'text one';
}
b2.onselect = function() {
content.innerHTML = 'text two';
}
</script>
onchange, notonselect.