| <html> |
| <head> |
| <script> |
| function log(msg) |
| { |
| document.getElementById("console").appendChild(document.createTextNode(msg + "\n")); |
| } |
| |
| function check(testNum, expected, actual) |
| { |
| var msg = "Test " + testNum; |
| if (expected == actual) |
| msg += " passed."; |
| else |
| msg += " failed. Expected: " + expected + " Actual: " + actual; |
| log(msg); |
| } |
| |
| function test() |
| { |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| |
| var up1 = document.getElementById("up1"); |
| var up2 = document.getElementById("up2"); |
| |
| check(1, up1.multiple, true); |
| check(2, up2.multiple, false); |
| |
| up1.multiple = false; |
| up2.multiple = true; |
| |
| check(3, up1.multiple, false); |
| check(4, up2.multiple, true); |
| |
| check(5, up1.getAttribute("multiple"), null); |
| check(6, up2.getAttribute("multiple"), ""); |
| } |
| </script> |
| </head> |
| <body onload="test()"> |
| This tests that you can get and set the multiple attribute as a property in JavaScript.<br> |
| <input type="file" id="up1" multiple> |
| <input type="file" id="up2"> |
| <pre id="console"></pre> |
| </body> |
| </html> |