I have a toggle button that shifts left to right depending what you select, I would like to change the colour of the text inside the button to white if that is the active toggle option you have selected so if you toggle the text inside goes white, however I'm not sure how to achieve this any help would be appreciated thank you
<div class="form-box">
<div class="button-box">
<div id="btn"></div>
<button type="button" class="toggle-btn" onclick="login()">Sign in</button>
<button type="button" class="toggle-btn" onclick="register()">Register</button>
</div>
.form-box {
width: 380px;
height: 660px;
position: relative;
margin: 20% auto;
padding: 5px;
overflow: hidden;
bottom: 150px;
}
.button-box {
width: 220px;
left: 100px;
top: 50px;
position: relative;
display: flex;
box-shadow: 0 0 10px 3px #ff61241f;
border-radius: 30px;
}
.toggle-btn {
padding: 10px 30px;
cursor: pointer;
background: transparent;
border: 0;
outline: none;
position: relative;
}
#btn {
display: flex;
margin-right: auto;
margin-left: auto;
position: absolute;
width: 110px;
height: 100%;
background-color: #fd886b;
border-radius: 30px;
transition: .5s;
}