select: appending options
October 8, 2007 - 4:42am — free_walker
| Project: | appendDom |
| Version: | 1.0.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | byron.adams54 |
| Status: | active |
Jump to:
Description
This code working just at Opera
at IE don't displaed attribute "text",
and at FF not working attribute "selected"
<html>
<head>
<title></title>
<script type="text/javascript" src="jquery-1.2.1.js"></script>
<script type="text/javascript" src="jquery-appendDom.js"></script>
</head>
<body>
<form>
<select id="edSelect" style="width: 150px;" size="5" multiple></select>
</form>
<script type="text/javascript">
$(document).ready(function(){
$("select#edSelect").appendDom([{tagName: "option", value: "1", text: "option 1"}]);
$("select#edSelect").appendDom([{tagName: "option", value: "2", text: "option 2"}]);
$("select#edSelect").appendDom([{tagName: "option", value: "3", text: "option 3", selected: "selected"}]);
$("select#edSelect").appendDom([{tagName: "option", value: "4", text: "option 4"}]);
});
</script>
</body>
</html>
Comments
#1