| <select multiple size=5 onchange="change()"><option>1</option><option>2</option></select> |
| var select = document.forms[0].elements[0]; |
| var res = document.getElementById("res"); |
| eventSender.keyDown("downArrow", []); |
| eventSender.keyDown("downArrow", ["shiftKey"]); |
| res.textContent = "Press down arrow."; |
| if (select.firstChild.selected && !select.firstChild.nextSibling.selected) { |
| select.appendChild(new Option("3", "3", false, false)); |
| res.textContent = "Press shift + down arrow."; |
| } else if (select.firstChild.selected && select.firstChild.nextSibling.selected && !select.lastChild.selected) |
| res.textContent = "Success."; |
| res.textContent = "Failed."; |