fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> </head> <body> <p>在搜索文本域中输入信息并按下 "ENTER" 键。</p> <input type="search" id="myInput" onsearch="myFunction()"> <p><strong>注意:</strong>Internet Explorer, Firefox 或 Opera 12 及其更早版本不支持 onsearch 事件。</p> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myInput"); document.getElementById("demo").innerHTML = "您搜索的内容为:" + x.value; } </script> </body> </html>
运行结果