title: Angular2 , check or uncheck a checkbox on click of a button
body: <p>I have an angular2 application where I want to dynamically check or uncheck based on user action.</p>
  
  <p>This is my functionality, </p>
  
  <ul>
  <li>I have a checkbox, on clicking this checkbox I ask a user to enter<br>
  his/her email and press a submit button.  After user presses the<br>
  submit button I show a pop-up saying your email has been saved. And I
  hide the text box and the submit button. Along with this I want to
  uncheck the   checkbox that user checked at first place to enter the
  email.</li>
  </ul>
  
  <p>When I try to use this </p>
  
  <pre><code>document.getElementById("checkBoxID").checked = false;
  </code></pre>
  
  <p>I get a compilation error </p>
  
  <blockquote>
    <p>Error:(33, 60) TS2339: Property 'checked' does not exist on type 'HTMLElement'.</p>
  </blockquote>
  
  <p>I researched somewhere and found that this property could be 'selected' instead of 'checked', but even that doesn't work.</p>
  
  <p>I can use a workaround of using *ngIf with a Boolean value and get two check-boxes written in my component, one with 'checked' and one with 'unchecked' and render them accordingly based on the Boolean value and keep setting the Boolean value on click of buttons, but I believe that would be the dirty solution.</p>
  
  <p>Angular2 for sure would have something simpler to do this, which I am missing here :(</p>