title: Video mute/unmute button javaScript
body: <p>JavaScript beginner here!</p>
  
  <p>I am trying to make a video player in javaScript for a school project but I am having trouble with my mute button.</p>
  
  <p>I want the button to mute the video when clicked and unmute if the button is pressed again. So far I have only been able to mute the video and keep it muted.</p>
  
  <p>Here is my current mute button.</p>
  
  <pre><code>var button = document.getElementById('mute');
      button.onclick = function (){
          video.muted = true;
      };
  </code></pre>
  
  <p>I tried an if else statement but it was unsuccessful</p>
  
  <pre><code>var button = document.getElementById('mute');
      button.onclick = function (){
  
      if (video.muted = false) {    
             video.muted = true;
      }
  
      else {
          video.muted = false;
      }
  
      };
  </code></pre>
  
  <p>Thanks for your help.</p>