The checkVisibility() method of the Element interface checks whether the element is visible.
checkVisibility()
MDN Reference