Latest web development tutorials

HTML DOM Input Text select() 方法

Input Text 對象參考手冊 Input Text對象

實例

選取文本域的內容:

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

嘗試一下»


定義和用法

select() 方法用於選取文本域中的內容。


瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主流瀏覽器都支持select() 方法。


語法

textObject .select()

參數

None.

技術詳情

返回值: 沒有返回值


Input Text 對象參考手冊 Input Text對象