dropdown.shuffle

description

Shuffles the options that have been added to the DropDown so far. If you call shuffle before settings.add then it will have no effect.

syntax

getDropDown(ELEMENT_NAME).shuffle()

alternate(s)

  • getDropDown(ELEMENT_NAME).shuffle( "keep selected" )

notes

  • Passing an argument means that you want any option currently selected to remain selected after the shuffle ("keep selected" is simply given as an example—you can pass an arbitrary string).

example(s)


@newDropDown("warmth", "")
@    .add("hot", "lukewarm", "cold")
$    .shuffle()
@,
@newText("Spring in Colorado is ")
@    .after( getDropDown("warmth") )
@    .print()
@,
@getDropDown("warmth")
@    .wait()
  • Creates a drop-down list containing the options hot, lukewarm and cold, shuffles them, adds the drop-down list to the right of the text Spring in Colorado is and prints everything onto the page, then waits until an option is selected from the drop-down list before proceeding.