Skip to content

Instantly share code, notes, and snippets.

@mrclay
Created November 23, 2022 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrclay/f5623c1ad85f933db1b48f13585897e1 to your computer and use it in GitHub Desktop.
Save mrclay/f5623c1ad85f933db1b48f13585897e1 to your computer and use it in GitHub Desktop.
Find empty HTML elements in DOM
[...document.querySelectorAll('h1,h2,h3,h4,h5,h6')].filter(el => !el.textContent.trim()).forEach(el => console.log(el))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment