javascript hide scrollbar

JavaScript
/* Hide scrollbar for Chrome, Safari and Opera */
.example::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE and Edge */
.example {
  -ms-overflow-style: none;
}/* On Chrome */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
/* For Firefox and IE */
.hide-scrollbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}// You can hide the document scrollbar with this...
document.body.style.overflow = 'hidden';
//...and unhide it with this:
document.body.style.overflow = 'visible';

// Or switch between them:
booleanCondition
  ? document.body.style.overflow = 'hidden'
  : document.body.style.overflow = 'visible';function HideScrollbar() {
  var style = document.createElement("style");
  style.innerHTML = `body::-webkit-scrollbar {display: none;}`;
  document.head.appendChild(style);
}
Source

Also in JavaScript: