Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ランダムなボタンをクリックした場合、カーソルが現在どの入力要素にあるかを定義する方法はありますか?
ボタンをクリックすると、カーソルは入力要素になくなります。
ただし、次のようなことができます。
<input onFocus="activeInput = this;" />
次に、ボタンをクリックすると、の値が見つかり、activeInput選択した入力要素が得られます。
activeInput