title: How to call JS function on click of JSF button and block page reload/navigation?
body: <p>What is the preferred way to create a button with JSF to call JS function ?</p>
  
  <p>Actually I use :</p>
  
  <pre><code>&lt;p:button onclick="myJSFunction();" href="#"/&gt;
  </code></pre>
  
  <p>but my urls are suffixed with the anchor symbol (<code>#</code>).</p>
  
  <p>Is there another recommended way to create button which will not reload/navigate to URL but call JS function please ?</p>