I wanted to select an option from a form. If I select this option, Javascript should check if the value/content is ex. "B".
How can Javascript now check if the value/content of this option is B or is not B?
<script type="text/javascript">
var text = document.form1.fahrstunden;
function a(){
if (document.form1.klasse.options[klasse.option.value=B].selected == true) {
alert("fu test");
}
}
</script>
<form onmousemove="a()" id="form1" name="form1"method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" onsubmit="a()" >
<select name="klasse" id="klasse" >
<option value="B" selected="selected">B</option>
</select>
</form>