title: Blazor JS Interop getElementById to get component reference
body: <p>I need, in Blazor, get a reference to a component by its ID.
  Note: Not using ElementReference, as it is for generic code.</p>
  <p>I've used this JS Interop script to do a focus and it works fine for me:</p>
  <pre><code>  public async Task Focus(string elementId){
                await js.InvokeVoidAsync(&quot;eval&quot;, $@&quot;document.getElementById(&quot;&quot;elementId}&quot;&quot;).focus()&quot;);
      }
  </code></pre>
  <p>But what I need from Blazor is get only a reference to the element (the component), that is, the return of: <code> document.getElementById(&quot;&quot;{elementId}&quot;&quot;)</code>
  sending it elementId as a parameter.</p>
  <p>Is it possible?</p>
  <p>Edit: I've tried with this script but always returns null when calling it from Blazor:</p>
  <pre><code>&lt;script&gt;
          window.GetElementById = (myId) =&gt; {
              return document.getElementById(myId);
          }
  &lt;/script&gt;
  </code></pre>