How are you adding options? What browsers are you targetting?
This works in IE 5+ and Netscape 6:
<html>
<head>
<title>Add option</title>
<script language="JavaScript" type="text/javascript">
function addOption(){
var oOption = document.createElement("option");
oOption.innerHTML = " Option three";
document.getElementById("optionSelect").appendChild(oOption);
}
</script>
</head>
<body>
<select id="optionSelect" style="font-family:Verdana; font-size:10px">
<option>Option one</option>
<option> Option two</option>
</select>
<input type="button" value="Add Option" onClick="addOption()">
</body>
</html>
/Robert
-----Original Message-----
From: Magnus Tullock [mailto:magnus.tullock@a...]
Sent: den 6 november 2001 13:21
To: javascript
Subject: [javascript] RE: list box formatting
the doesnt work either as I am wanting to update the list from
Javascript and when I use either \t or I get black or white boxes
respectivly
> You can change the font with stylesheets:
>
> <select style="font-family:Verdana; font-size:10px">
> <option>Option one</option>
> <option>Option two</option>
> </select>
>
> To achieve tabs, you can can put before the text:
>
> <option> Option one</option>
>
>
> /Robert
>
>
>
> -----Original Message-----
> From: Magnus Tullock [mailto:magnus.tullock@a...]
> Sent: den 6 november 2001 09:43
> To: javascript
> Subject: [javascript] list box formatting
>
>
> hey guys,
> is it possible to change the font in a list box and also to put a tab in
> it as well (ie I would use the \t command in a text area)
>
> cheers
> Magnus