I have multiple tabs and I want to indicate when a change occurs on another tab that the user hasn't clicked. For example, if the user hits the run button while on the Data pane, I would like the Errors tab to change to red to show that there was a change on that tab as well. How can I achieve this? Conversely, if they're on the error tab, the Data tab should turn red. Also, once the tab is clicked, I want to remove the red color. Any assistance would be appreciated!
Desired Output
https://i.sstatic.net/BozhN.png
runCode = () => {
document.getElementById("dataOutput").innerHTML = "Paragraph changed!";
document.getElementById("errorOutput").innerHTML = "Error Occurred";
}
.fab {
width: 60px;
height: 60px;
background-color: #A7C0CD;
border-radius: 50%;
box-shadow: 0px 3px 15px rgba(0,0,0,0.2);
transition: all 0.1s ease-in-out;
font-size: 15px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
color: white;
text-align: center;
line-height: 58px;
float: right;
margin: 8px;
z-index: 5000;
position: absolute;
right:0;
top:0;
}
.fab:hover {
box-shadow: 0px 3px 15px rgba(0,0,0,0.2);
transform: scale(1.05);
}
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
</head>
<!-- Visual appearance -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap/dist/js/bootstrap.min.js"></script>
<body>
<div class="fab" id="runCode" onclick="runCode();">RUN</div>
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#data">Data</a></li>
<li><a data-toggle="tab" href="#error">Errors</a></li>
</ul>
<div class="tab-content">
<div id="data" class="tab-pane fade in active">
<div id="dataOutput"></div>
</div>
<div id="error" class="tab-pane fade">
<div id="errorOutput"></div>
</div>
</div>
</body>
</html>