How to set the focus to an InputText element?
问题 Using the example from the Microsoft docs, I'm trying to programmatically set the focus to an input element. Unfortunately, the example uses a standard <input type="text"> whereas I want to use it for an InputText element. The Microsoft example uses an extensions method that takes an ElementReference : public static Task Focus(this ElementReference elementRef, IJSRuntime jsRuntime) { return jsRuntime.InvokeAsync<object>( "exampleJsFunctions.focusElement", elementRef); } Using an InputText , I