title: Javascript click event not working in Blazor client side app
body: <p>I'm new to Blazor and I've created a pretty simple Webassembly app. I want a href link to go to a div lower down the page when I click on it, but the Javascript click event won't work. In the Index.razor page the <code>JsRuntime.InvokeVoidAsync("clicker")</code> is working and the <code>alert("In clicker")</code> happens as the page loads, but the click / href to go the "intro" div will not work for love nor money :-/</p>
  
  <p>index.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;My Blazor App&lt;/title&gt;
      &lt;!--script type='text/javascript' src='./scripts/app.js'--&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;app&gt;Loading...&lt;/app&gt;
      &lt;script src="_framework/blazor.webassembly.js"&gt;&lt;/script&gt;
      &lt;script&gt;
          function clicker() {
              alert("In clicker"); // this works
              document.getElementById('skip').onclick = function(e){
                  alert("clicked"); // this works but the page still won't scroll to the "intro" div :(
              }
          }
          //clicker();
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Index.razor (@code section is at top of page)</p>
  
  <pre><code>@page "/"
  @code {
      [Inject]
      protected IJSRuntime JsRuntime { get; set; }
  
      protected override void OnAfterRender(bool firstRender)
      {
          if (firstRender)
          {
              JsRuntime.InvokeVoidAsync("clicker");
          }
      }
  }
  
  // This link won't go to the intro div when clicked :(
  &lt;a id="skip" class="skip" href="#intro"&gt;skip this bit&lt;/a&gt;
  ...
  &lt;div id="intro" class="home"&gt;
  ...
  &lt;/div&gt;
  </code></pre>
  
  <p>Startup.cs</p>
  
  <pre><code>public class Startup
  {
      public void ConfigureServices(IServiceCollection services)
      {
      }
  
      public void Configure(IComponentsApplicationBuilder app)
      {
          app.AddComponent&lt;App&gt;("app");
      }
  }
  </code></pre>
  
  <p>If anyone could shed some light on this it would save my week.</p>