select.focus();
for (var i = 1; i < select.length; i++) {
synthesizeKey("KEY_ArrowDown");
is(select.options[i].selected, true, "Option should be selected");
is(selectChange, ++expectedChange, "Down key should fire change event.");
}
// We are at the end of the list, going down should not fire change event.
synthesizeKey("KEY_ArrowDown");
is(selectChange, expectedChange, "Down key should not fire change event when reaching end of the list.");
for (var i = select.length - 2; i >= 0; i--) {
synthesizeKey("KEY_ArrowUp");
is(select.options[i].selected, true, "Option should be selected");
is(selectChange, ++expectedChange, "Up key should fire change event.");
}
// We are at the top of the list, going up should not fire change event.
synthesizeKey("KEY_ArrowUp");
is(selectChange, expectedChange, "Up key should not fire change event when reaching top of the list.");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.