title: Blazor conditional if statement for onclick
body: <p>I have a span which should have an onclick attribute if the IsActive bool is true.
  Otherwise the span should have no onclick attribute.</p>
  <p>e.g.</p>
  <pre><code>@if (IsActive == true)
  {
      &lt;span @onclick=&quot;@(e =&gt; Go.DoSomething(&quot;please&quot;))&quot;&gt;
          @s.DisplayText
      &lt;/span&gt;
  }
  else
  {
      &lt;span&gt;
          @s.DisplayText
       &lt;/span&gt;
  }
  </code></pre>
  <p>Is there not a way to avoid the repeated code using a ternary operator? e.g.</p>
  <pre><code>@(IsActive == true ? &quot;add onclick method somehow?&quot; : &quot;&quot;)
  </code></pre>