Skip to content

Latest commit

 

History

History

isxpresent

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Is x present?

Checks if elements that usually should be present, are actually there and if elements that probabaly shouldn’t be present, aren’t there.

Copy the script.

Demo output of the “Is x present?” script that lists a bunch of warning related to malformed HTML

Stuff that probably should be present

  • <header>
  • <nav>
  • <footer>
  • <main>

Stuff that probably shouldn’t be present

  • a:not([href])
    Placeholder link (fine) or fake link/button (bad)
  • a[href="#"]
    Link with empty hash
  • a[tabindex]
    Is fake link?
  • [role="menuitem"]
    menu and menuitem must not be used for typical navigations on websites
  • [role="button"]
    Is fake button?
  • [role="link"]
    Is fake link?
  • div[onclick]
    Is fake link/button?
  • img[onclick]
    Is fake link/button?
  • label[aria-label]
    Redundant label
  • label a
  • button a
  • a button
    Nesting interactive elements should be avoided
  • section > section
  • article > section
    Excessive use of sectioning content
  • [style]
    It’s a best practice to avoid inline styles
  • table[role="grid"]
    Are you sure about using role="grid"?

Resources