Top Rounds
| We are Hiring! |

_setSelected ·

This is a Browser Action API.

It is used to select an option from a select box.

Syntax:

_setSelected ( element, option_identifier, isMultiple)
The parameters are:

  • element:
  • option_identifier: Option’s text, id or index; can also pass an array of options for multi-select
  • isMultiple: true for multiselect, optional for single select

Example:

_setSelected(_select(“Age”), “28”);
_setSelected(_select(“color”), 1); // Selects the second option in a select box
_setSelected(_select(“color”), “red”); // Selects red in a multiselect box
_setSelected(_select(“color”), “blue”, true); // Selects blue also in the multiselect box
_setSelected(_select(“color”), [“red”, “blue”]); // Unselects previous and selects red and blue in a multiselect box
_setSelected(_select(“color”), [1,2,3]); // Unselects previous and selects the second, third and fourth options in a multiselect box
_setSelected(_select(“color”), [“green”, “yellow”], true); // Keeps previous options selected and selects “green” and “yellow” also




---


Top Rounds