📚Cheatsheets

Cheatsheet collection for go, rust, python, shell and javascript.

Find html element that causing horizontal scroll in mobile screen

const documentWidth = document.documentElement.offsetWidth;

document.querySelectorAll("*").forEach((node) => {
  if (node.offsetWidth > documentWidth) {
    console.log(node);
  }
});

Reference: Quickly Find the Element That Is Causing Horizontal Scrolling