Dynamic form entry

Here is a very simple code snippet to select a random value from a list of options, to use that random value in a form field entry.

var searchList = ["cats", "dogs", "pigs", "muffins"];
var num = Math.floor((Math.random() * 4));
searchTerm = searchList[num];

In this simple demo, the random option is then used in a Google search to provide different results.

A demo script can be downloaded here as well: DynamicSearchExample.gsl.