title: Change Text Color with Switch/Toggle Css/javascript
body: <p><strong>Thank you for reading this question</strong></p>
  
  <ul>
  <li>Actually, I am trying to create a login form for student and teachers</li>
  <li>Where there is a Switch/toggle button between Teacher and Student text</li>
  <li>I want to change the colour (let say to grey from green) of the text when the switch toggle to respective(teacher/student)</li>
  <li>For Example, if I pressed the switch and the toggle ball sift to right means the Student text will be grey and the same for the opposite side </li>
  </ul>
  
  <p><strong>Here is my code</strong>
  <strong>index.html</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.form-container{
              text-align: center;
              border-radius: 5px;
              background-color: #f6f6f6;
              padding: 30px 10px 30px 10px;
              margin: 0% 5% 0% 5%;
              font-family: 'Poppins', sans-serif;
              font-weight: 700;
              font-size: 30px;
              color: green;
              -webkit-box-shadow: 5px 5px 5px -1px rgba(0,0,0,0.41);
              -moz-box-shadow: 5px 5px 5px -1px rgba(0,0,0,0.41);
              box-shadow: 5px 5px 5px -1px rgba(0,0,0,0.41);
          }
          .input-design{
              margin: 0% 15% 0% 15%;
              margin-top: 50px;
          }
          .input-design input[type=text]{
              height: 50px;
              width: 100%;
              padding: 0px 0px 0px 10px;
              font-size: 20px;
              margin-bottom: 20px;
          }
          .input-design input[type=password]{
              height: 50px;
              width: 100%;
              padding: 0px 0px 0px 10px;
              font-size: 20px;
          }
          .button-design{
              padding: 15px 0px 0px 0px;
              height: 50px;
              font-weight: 600;
              font-size: 20px;
              margin: 5% 15% 5% 15%;
              background-color: green;
              color: white;
              border:1px solid white;
          }
          .button-design:hover{
  
              border:1px solid green;
              background-color: white;
              color: green;
          }
  
          .switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
  }
  
  .switch input { 
    opacity: 0;
    width: 0;
    height: 0;
  }
  
  .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
  }
  
  .slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
  }
  
  input:checked + .slider {
    background-color: #2196F3;
  }
  
  input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
  }
  
  input:checked + .slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
  }
  
  /* Rounded sliders */
  .slider.round {
    border-radius: 34px;
  }
  
  .slider.round:before {
    border-radius: 50%;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;
          &lt;div class="form-container"&gt;
              &lt;div class="role-selector"&gt;
                  Teacher
                  &lt;label class="switch"&gt;
                          &lt;input type="checkbox"&gt;
                          &lt;span class="slider round"&gt;&lt;/span&gt;
                        &lt;/label&gt;
                  Student
              &lt;/div&gt;
              &lt;div class="input-design"&gt;
                  &lt;input type="text" name="username" placeholder="Username"&gt;
                  &lt;input type="password" name="password" placeholder="Password"&gt;
              &lt;/div&gt;
              &lt;div class="button-design"&gt;
                  Login
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>