jQuery toggleClass example

Toggle class name on click in jQuery

by Alexey Sharifullin

HTML

<script src="https://www.htmlelements.com/demos/source/modules/smart.tabs.js"></script>
<link rel="stylesheet" href="https://www.htmlelements.com/demos/source/styles/smart.default.css">
<script src="https://www.htmlelements.com/demos/source/modules/smart.input.js"></script>
<div style="height: 100%">


<smart-tabs id="tabs" style="height: 100%">
			<smart-tab-item label="Q1: Make scrollable">
      <div  style="height: 100%; overflow: auto;" class="my">
      <h1>
      <strike>How to make content scrollable???     </strike> Done
      </h1>
      <h3>Part 1</h3>
      <p>
			Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum
      </p>
      <h3>Part 2</h3>
      <p>
			Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum
      </p>
      <h3>Part 3</h3>
      <p>
			Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown...

CSS

html {
  height: 100%;
}

body {
  padding: 0 0 0 0;
  margin: 0 0 0 0;
  position: absolute;
  height: 100%;
  overflow: hidden;
}

.my {
  overflow: auto;
  height: 100%;
}

.first-box {
  height: 150px;
  width: 100%;
  background-color: cyan;
}

.second-box {
  height: 100px;
  background-color: yellow;
}

JavaScript

window.onload = function () {
let input = document.querySelector('smart-input');
    input.dataSource = [
        { label: "Andrew Watson" },
        { label: "Anne Kean" },
        { label: "Avril Janin" },
        { label: "Janet Pattenson" },
        { label: "Johanna Svensson" },
        { label: "Johnny Abana" },
        { label: "Laura Thene" },
        { label: "Margaret Vetton" },
        { label: "Maria Sevrano" },
        { label: "Mark Yemen" },
        { label: "Maya Verdara" },
        { label: "Michael Barton" },
        { label: "Monica Oghini" },
        { label: "Nancy Queens" },
        { label: "Robert Drawny" },
        { label: "Steven Fedrichy" },
        { label: "Toni Versachi" }
    ];
    }