WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
Bug 26901
Cannot set the length of a select to zero using javascript.
https://bugs.webkit.org/show_bug.cgi?id=26901
Summary
Cannot set the length of a select to zero using javascript.
Gene Chow
Reported
2009-07-01 13:41:59 PDT
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>
Attachments
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2009-07-08 07:29:05 PDT
Could you please clarify why this bug was marked as INVALID?
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug