You can use the special clear
command to remove from the screen any element that was previously added during the trial.
Example:
[js try=”true”]newText(“helloworld”, “Hello world!”)
.print()
,
newImage(“smiley”, “ya.png”)
.print()
,
newButton(“erase”, “Erase”)
.print()
.wait()
,
clear()
,
newButton(“void”, “Enough with the emptiness”)
.print()
.wait()
[/js]
Adds a line of text, an image and an Erase button to the screen. When the Erase button is clicked, all these three elements disappear from the screen, and a new button is added to the screen, waiting to be clicked.
Index
- Tutorial
- Commands by element categories
- Standard Element Commands
- Audio element
- Button element
- Canvas element
- DropDown element
- EyeTracker element
- Function element
- Html element
- Image element
- Key element
- MediaRecorder element
- Scale element
- Selector element
- Text element
- TextInput element
- Timer element
- Tooltip element
- Var element
- Video element
- Youtube element
- Special clear command
- Special end command
- Global PennController Commands
- PennController
- PennController.AddHost
- PennController.AddTable
- PennController.CheckPreloaded
- PennController.Debug
- PennController.DownloadVoiceButton
- PennController.FeedItems
- PennController.Footer
- PennController.GetTable
- PennController.GetURLParameter
- PennController.Header
- PennController.InitiateRecorder
- PennController.PreloadZip
- PennController.ResetPrefix
- PennController.SendResults
- PennController.Sequence
- PennController.SetCounter
- PennController.Template
- Installing PennController
- Ontology
- Aesthetics
- Preloading resources
- ZIPped resources
- Spreadsheet (CSV)
- Canvas creation
- Setup for audio recordings collection