Mein Skript:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>test</title>
<script type="text/javascript">
<!--
function update() {
var anz=document.getElementById("test").getElementsByTagName("option").length;
alert (anz);
}
// -->
</script>
</head>
<html>
<body>
<form name='albumMgmt'>
<table>
<tr>
<td>
<select name="albums" size="5" multiple>
<option value='Album1'>Album1</option>
<option value='Album2'>Album2</option>
<option value='Album3'>Album3</option>
<option value='Album4'>Album4</option>
</select>
</td><td>
<select name="user" size="5" multiple>
<option value='1'>User1</option>
<option value='2'>User2</option>
<option value='3'>User3</option>
<option value='4'>User4</option>
</select>
</td><td>
<input type='button' value='-->' onClick='update()' />
<br />
<input type='button' value='<--' submit='update()' />
</td><td>
<select name="relations" size="5" multiple>
<optgroup label='Album1'>Album1
<option value='Album2'>Album2</option>
</optgroup>
<optgroup label='Album7' id='test'>Album7
<option value='Album3'>Album3</option>
<option value='Album4'>Album4</option>
</optgroup>
</select>
</td>
</tr>
</table>
</form>
</body>
</html>