newbie - HTML SELECT addOption does not work in firefox
jquery newbie here
Been scratching my head for a couple of hours over this.
I am trying to add select items via jquery to a select control.
The following code works perfectly in IE, Opera. Chrome and Safari, but for the life of me I cant get it working in firefox.
I really dont think its a bug but I must be missing something obvious.
-
<html>
<head>
<script type="text/javascript" src="../lib/jquery/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="../lib/jquery/js/jquery.selectboxes.pack.js"></script>
<script type="text/javascript">
$(document).ready(function() {
PopulateSelect();
});
function PopulateSelect(){
$("#s1").removeOption(/./);
$("#s1").addOption("Value1", "Text1");
$("#s1").addOption("Value2", "Text2");
};
</script>
</head>
<body>
<select name="s1" id="s1" onchange=""> </select>
<input type="button" name="button" id="button" value="Button" onClick="javascript:PopulateSelect()">
</body>
</html>
Any ideas?
regards
AA