Skip to content

devAsadNur/vanilla-js-tabs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Vanilla JS Tabs

Features:

  • Coded with HTML, CSS and Vanilla Javascript
  • Supports multiple tabs in a single page
  • Light weight and faster

Requirements:

  1. The tab murkups need to be placed inside of "tab-wrapper" class in HTML.
  2. Each tab selector must have the "tab-item" class and "data-tab" attribute in HTML. No matter those are the list items, buttons or any other elements.
  3. Each tab panel must have the "tab-panel" class and "data-tab" attribute in HTML.
  4. Associated tab selector and tab panel, both must have the same value for their "data-tab" attribute.
  5. "active" class must be added to the default tab selector and tab panel in HTML.

Thanks for using this. Feel free to leave a comment if you have any suggestion.