aboutsummaryrefslogtreecommitdiff
path: root/exampleData/ruleSets/accessibility/imagesAltText.js
diff options
context:
space:
mode:
Diffstat (limited to 'exampleData/ruleSets/accessibility/imagesAltText.js')
-rw-r--r--exampleData/ruleSets/accessibility/imagesAltText.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/exampleData/ruleSets/accessibility/imagesAltText.js b/exampleData/ruleSets/accessibility/imagesAltText.js
new file mode 100644
index 0000000..8941caf
--- /dev/null
+++ b/exampleData/ruleSets/accessibility/imagesAltText.js
@@ -0,0 +1,14 @@
+exports.name = "imagesAltText";
+
+exports.description = "Each image should have an alternative text description";
+
+exports.rule = function() {
+ var that = this;
+ fiveui.query('img')
+ .filter(function (i) {
+ return $(this).attr('alt') == '';
+ })
+ .each(function (i, e) {
+ that.report('Image has no alt text', e);
+ });
+};