Full version, Basic version

Specification link: 16.2 Complete list of supported events

interact-dom-01-b ← index → interact-order-01-b

# interact-events-01-b
SVG Image | PNG Image
interact-events-01-b Test 'onload' event attribute. function onEvent(evt, indicatorId, visibilityValue){ // Get Document var target = evt.target; var doc = target.ownerDocument; // Mark test as passed var elementToShow = doc.getElementById(indicatorId); elementToShow.setAttribute('visibility', '' + visibilityValue); } 'onload' event attribute. 1: No 2: Yes 3: Yes 4: Yes 5: No 6: Yes $Revision: 1.2 $ |

Test 'onload' event attribute.

Six blue rectangles have been defined, each initially defined with 'visibility:hidden'. 'onload' event attributes are assigned in a variety of ways, usually to set 'visibility:visible'. The red text indicates the correct behavior (whether a given rectangle should appear in the visual result).

The first rectangle has no associated 'onload' event so it remains invisible. The second rectangle has an 'onload' event on itself, which invokes a script which sets 'visibility:visible', so it should appear. The third rectangle has an 'onload' event on its parent 'g', which invokes a script which sets 'visibility:visible' on the rectangle, so it should appear. The fourth rectangle has an 'onload' event on an ancestor 'svg', which invokes a script which sets 'visibility:visible' on the rectangle, so it should appear. The fifth rectangle has an 'onload' event both itself and its parent 'g'. The rectangle's script sets 'visibility:visible' on the rectangle but the parent's script sets 'visibility:hidden' on the rectangle, which should happen afterwards, so the rectangle should not appear. The sixth rectangle has an 'onload' event on the outermost 'svg', which invokes a script which sets 'visibility:visible' on the rectangle, so it should appear.

interact-dom-01-b ← index → interact-order-01-b