title: Javascript - onclick function change boolean value and change attr visibility
body: <p>So I'm learning Javascript and I have a doubt on changing a global variable with boolean variable, while changing the attr of visibility on an element.</p>
  
  <p>The code is this:</p>
  
  <pre><code>var lastView=false;
  
  $("#idShipmentActionsCombo-icon").on('click', function(){
  
  if (lastview=false){
  
  $('#idShipmentActionsCombo-lb').attr('style', 'visibility: visible');
      lastView=true;
  
  }
  
  else if(lastView=true){
  
  $('#idShipmentActionsCombo-lb').attr('style', 'visibility: hidden');
      lastView===false;
  
      }
  }
  </code></pre>
  
  <p>So <code>#idShipmentActionsCombo-icon</code> is the element I click in, <code>#idShipmentActionsCombo-lb</code> and this is what I want to show and hide depending on the value of lastView.</p>
  
  <p>Thanks in advance, and I apologize for my English since it's not my main language.</p>