title: How to use document.getElementById() method in Angularjs
body: <p>I have written <code>hide()</code> and <code>show()</code> functions in javascript and calling them on <code>onmousedown</code> in <code>HTML</code> code. </p>
  
  <p><strong>Functions as below:</strong></p>
  
  <pre><code>function show() {
    document.getElementById("formDiv").style.display = "block";
  }
  
  function hide() {
    document.getElementById("formDiv").style.display = "none";
  }
  </code></pre>
  
  <p>I want to convert this into <code>Angularjs</code> code. Can I write like this? </p>
  
  <pre><code>$scope.show = function() {
    document.getElementById("formDiv").style.display = "block";
  }
  
  $scope.hide = function() {
    document.getElementById("formDiv").style.display = "none";
  }
  </code></pre>
  
  <p>Can we use <code>document.getElementById()</code> in <code>Angularjs</code>? I am new to <code>angularjs</code>. Can anyone please help me out for this?</p>