[Webkit-unassigned] [Bug 26901] New: Cannot set the length of a select to zero using javascript.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Jul 1 13:41:59 PDT 2009
https://bugs.webkit.org/show_bug.cgi?id=26901
Summary: Cannot set the length of a select to zero using
javascript.
Product: WebKit
Version: 528+ (Nightly build)
Platform: Macintosh Intel
OS/Version: Mac OS X 10.5
Status: UNCONFIRMED
Severity: Critical
Priority: P1
Component: JavaScriptCore
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: gene at chowww.com
The options array for a select cannot be cleared. The code below does not work
as expected using Safari 4.01 (5530.18).
-----------
<html>
<head>
<script type="text/javascript">
function load() {
var sel = document.getElementById("select");
for (var i = 0; i < 20; i++) {
var opt = new Option('option '+i, i, false,
false);
sel.options[sel.length] = opt;
}
alert(sel.length);
sel.length = 0;
alert(sel.length);
sel.options.length = 0;
alert(sel.options.length);
}
</script>
</head>
<body onload="load()">
<select id="select"></select>
</body>
</html>
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the webkit-unassigned
mailing list