raster image of script-element-202-t

Test that scripts are not processed until added to the DOM tree. Also test that a function defined in a script element can be called from a handler element in the same scripting context.

When the blue rect is clicked a script element is created. The script to be run must not be processed until the script element is added to the tree. If it is processed before added to the tree, the rect that is inserted into the document will be red. If not, then it will be green.

The test has passed if after clicking the blue rect a green rect is displayed in its place.