aboutsummaryrefslogtreecommitdiff
path: root/exampleData/ruleSets/basic/emptyHrefs.js
diff options
context:
space:
mode:
Diffstat (limited to 'exampleData/ruleSets/basic/emptyHrefs.js')
-rw-r--r--exampleData/ruleSets/basic/emptyHrefs.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/exampleData/ruleSets/basic/emptyHrefs.js b/exampleData/ruleSets/basic/emptyHrefs.js
new file mode 100644
index 0000000..a333842
--- /dev/null
+++ b/exampleData/ruleSets/basic/emptyHrefs.js
@@ -0,0 +1,12 @@
+exports.name': "Don't use empty hrefs."
+exports.description': "Links with no text can't generally be used."
+exports.rule =
+ function() {
+ var that = this;
+ fiveui.query('a').each(
+ function(i, elt) {
+ if ($(elt).text() == '' && elt.title == '') {
+ that.report('Link has no text', elt);
+ }
+ });
+ };