grundlegendes Verständnisproblem
alte
- javascript
Warum geht:
<html>
<head>
<script type="text/javascript" >
function los_geht(wert) {
alert(wert);
}
</Script>
</head>
<body>
<select name="wurst">
<option value="1" onSelect="los_geht(this.value);">1</option>
<option value="2" onSelect="los_geht(this.value);">2</option>
<option value="3" onSelect="los_geht(this.value);">3</option>
<option value="4" onSelect="los_geht(this.value);">4</option>
<option value="5" onSelect="los_geht(this.value);">5</option>
<option value="6" onSelect="los_geht(this.value);">6</option>
</select>
</body>
</html>
im IE nicht und im FF schon???
<option value="1" onSelect="los_geht(this.value);">1</option>
...
im IE nicht und im FF schon???
Weil der onselect event nicht bei options definiert ist, du suchst onchange
<select onchange="los_geht(this.options[this.selectedIndex].value);"...>
Struppi.
<select name="wurst">
<option value="1" onSelect="los_geht(this.value);">1</option>
<option value="2" onSelect="los_geht(this.value);">2</option>
</select>
</body>
</html>
Wieso so komplziert?
<select name="wurst" onchange="los_geht(this.value);">
<option value="1">1</option>
<option value="2">2</option>
sollte so gehen oder liege ich da falsch ?