Skip to main content Link Menu Expand (external link) Document Search Copy Copied

DropDown element

description

Represents a drop-down list.

syntax

newDropDown(ELEMENT_NAME: string, DEFAULT_TEXT: string)
  • ELEMENT_NAME: The name of the newly-created element.
  • DEFAULT_TEXT : represents default text displayed

note(s)

  • By default, a DropDown element does not have any options. To add options, use the command dropdown.add.
  • The "DEFAULT_TEXT" string parameter does not create a drop-down list option.

since

PennController 1.2

example(s)


newTrial("option-1",
    newText("like", "I like ")
    ,
    newDropDown("fruits", "(select a fruit)")
        .add("apples", "bananas", "oranges")
        .before(getText("like"))
        .print()
)

newTrial("option-2",
    newDropDown("fruits", "(select a fruit)")
        .add("apples", "bananas", "oranges")
    ,
    newText("like", "I like ")
        .after(getDropDown("fruits"))
        .print()
)

Action commands










Test commands