Good! you are a quick learner!
The beauty of physlet is to be able to use javascript to change different behavior at run time.
Actually, you can also use javascript to call build in functions or user defined functions (or variables) in EJS generated simulations to change simulation at run time.