Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="tab" style="margin-top: 1.6%;">
- <button class="tablinks" onclick="openCity(event, 'Sun0')">Sun</button>
- <button class="tablinks" onclick="openCity(event, 'Mon0')">Mon</button>
- <button class="tablinks" onclick="openCity(event, 'Tue0')">Tue</button>
- <button class="tablinks" onclick="openCity(event, 'Wed0')">Wed</button>
- <button class="tablinks" onclick="openCity(event, 'Thu0')">Thu</button>
- <button class="tablinks" onclick="openCity(event, 'Fri0')">Fri</button>
- document.getElementsByClassName('tablinks').click()
- function openCity(evt, cityName) {
- var i, tabcontent, tablinks;
- tabcontent = document.getElementsByClassName("tabcontent");
- for (i = 0; i < tabcontent.length; i++) {
- tabcontent[i].style.display = "none";
- }
- tablinks = document.getElementsByClassName("tablinks");
- for (i = 0; i < tablinks.length; i++) {
- tablinks[i].className = tablinks[i].className.replace(" active", "");
- }
- document.getElementById(cityName).style.display = "block";
- evt.currentTarget.className += " active";
- }
- <div id="Sun0" class="tabcontent">
- <!--Sunday-->
- <div style="overflow-x:auto;">
- <p> Contents of Sun0 </p>
- </div>
- <div id="Mon0" class="tabcontent">
- <!--Monday-->
- <div style="overflow-x:auto;">
- <p> Contents of Sun0 </p>
- </div>
- <div id="Tue0" class="tabcontent">
- <!--Tueday-->
- <div style="overflow-x:auto;">
- <p> Contents of Sun0 </p>
- </div>
- <div id="Wed0" class="tabcontent">
- <!--Wenesday-->
- <div style="overflow-x:auto;">
- <p> Contents of Sun0 </p>
- </div>
- <div id="Thu0" class="tabcontent">
- <!--Thursday-->
- <div style="overflow-x:auto;">
- <p> Contents of Sun0 </p>
- </div>
- <div id="Fri0" class="tabcontent">
- <!-Friday-->
- <div style="overflow-x:auto;">
- <p> Contents of Sun0 </p>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement