執行 ❯
建立您
自己的
網站
×
更改方向
儲存程式碼
更改主題,深色/淺色
前往 Spaces
<!DOCTYPE html> <html> <body> Homepage: <input type="url" id="myURL" value="http://www.google.com"> <p>Click the buttons below to give focus and/or remove focus from the URL field.</p> <button type="button" onclick="getFocus()">Get focus</button> <button type="button" onclick="loseFocus()">Lose focus</button> <script> function getFocus() { document.getElementById("myURL").focus(); } function loseFocus() { document.getElementById("myURL").blur(); } </script> </body> </html>