JSFiddle - React, Tailwind, and code Playground

HTML

<div class="tabview">
  <button class="tabLink" onclick="tabClick(event, 'tabone')">TabOne</button>
  <button class="tabLink" onclick="tabClick(event, 'tabtwo')">TabTwo</button>
  <button class="tabLink" onclick="tabClick(event, 'tabthree')">TabThree</button>
</div>
<div id="tabone" class"tabscontent">
<p>
Tab content One
</p>
</div>
<div id="tabtwo" class"tabscontent">
<p>
Tab content Two
</p>
</div>
<div id="tabthree" class"tabscontent">
<p>
Tab content Three
</p>
</div>

<!--
Build a tab component using plain HTML/CSS/JavaScript.

In case you forget any API method, attribute name, etc, you can search on any reference website like MDN, etc. You are not allowed to search for the solution of the problem.

Try to use all the best practices you know about HTML, CSS and JavaScript to build this component.

Mockup:
https://i.imgur.com/Qk71XWl.jpg

Please make the component fully functional. The content can be static in the HTML.
-->

CSS

.tabscontent{
  display:none;
}

JavaScript

function tabClick(event, tabid) {
var i,
content,
links;
tabscontent = document.getElementsByClassName("tabscontent");
console.log(tabscontent);
for (i=0; i<tabscontent.length; i++){
tabscontent[i].style.display="none";
}
tabLink = document.getElementsByClassName("tabLink");
for (i=0; i<tabLink.lenght; i++){
tabLink[i].className=tablink[i].className.replace("active", " ");
}
document.getElementById("tabid").style.display = "block";
event.currentTarget.className +="active";
}