Input Text focus()メソッド

Input Text 对象参考手册Input Text オブジェクト

インスタンス

テキストフィールドがフォーカスを取得:

document.getElementById("myText").focus();

試してみる »


定義と用法

focus() メソッドはテキストフィールドがフォーカスを取得するために使用されます。

ヒント:使用法blur()メソッドでテキストフィールドのフォーカスを失わせます。


ブラウザサポート

Internet Explorer Firefox Opera Google Chrome Safari

すべての主要ブラウザは focus() メソッドをサポートしています。


構文

textObject.focus()

パラメータ

None.

技術詳細

戻り値: 戻り値なし


Input Text 对象参考手册Input Text オブジェクトその他の拡張