title: TS2339: Property 'href' does not exist on type 'HTMLElement'
body: <p>I am experiencing this problem:</p>
  <p>I cannot access the property <em>href</em> to an HTML element.
  I am getting this error:</p>
  <pre><code>Property 'href' does not exist on type 'HTMLElement'.ts(2339)
  </code></pre>
  <p>This is the code:</p>
  <pre><code>@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
  })
  export class AppComponent implements AfterViewInit {
    title = 'clientes-app';
  
    ngAfterViewInit(){
      (function($) {
          &quot;use strict&quot;;
      
          var path = window.location.href; 
              $(&quot;#layoutSidenav_nav .sb-sidenav a.nav-link&quot;).each(function() {
                  if (this.href === path) {
                      $(this).addClass(&quot;active&quot;);
                  }
              });
      
          // Toggle the side navigation
          $(&quot;#sidebarToggle&quot;).on(&quot;click&quot;, function(e) {
              e.preventDefault();
              $(&quot;body&quot;).toggleClass(&quot;sb-sidenav-toggled&quot;);
          });
      })(jQuery);
    }
  }
  </code></pre>