title: Listen to button events with Shiny.OnInputChange - R Shiny
body: <p>What is the right way of listening of an event generated by a button in index.html??
  In index.html:</p>
  
  <pre><code>&lt; button class='btn btn-primary btn-custom w-md waves-effect waves-light' id='.loginButton' style='width: 20%' type='button' onclick='myFucntion()'&gt;Log In&lt; /button&gt;
  
        &lt;script type = 'text/javascript'&gt;
  function myFunction() {
      document.getElementById('.loginButton').style.color = 'red';
  Shiny.onInputChange('.loginButton',1)
  }&lt;/script&gt;
  </code></pre>
  
  <p>In server.R:</p>
  
  <pre><code>  observeEvent(input$.loginButton,{print("YEAH")})
  </code></pre>
  
  <p>I does seem to work with input field, but not with buttons.</p>