ally.is.validArea

September 28, 2016 · View on GitHub

Determines if an <area> element is properly used via <map> by an <img>.

Description

Usage

var element = document.getElementById('victim');
var isValidArea = ally.is.validArea(element);

Arguments

NameTypeDefaultDescription
elementHTMLElementrequiredThe Element to test.

Returns

Boolean, true if the element is a valid area.

Throws

TypeError if element argument is not of type HTMLElement.

Examples

Changes

  • Since v1.1.0 the <img usemap="#…" …> is resolved in the same document <map> is from (e.g. within an iframe)
  • Since v1.1.0 the existence of the href attribute is considered.

Notes

:::note The object element's usemap attribute should be deprecated. :::

:::note The Sequential Navigation Focus Order for Image Maps is not standardized. :::

:::note Firefox only allows fully loaded images to reference image maps. :::

:::warning Multiple use of same image map hides elements from tabbing sequence - Gecko 1116126 :::

Contributing