js 文字框鍵盤輸入事件
阿新 • • 發佈:2019-02-20
html
js<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title> <link href="../Content/StyleSheet7.css" rel="stylesheet" /> <script src="../Scripts/cxc.js"></script> <script src="../Scripts/JavaScript7.js"></script> <meta charset="utf-8" /> </head> <body> <ul> <li><input type="text" id="txt" /></li> <li id="show"></li> </ul> </body> </html>
window.onload = function () {
AddEvent($("txt"), EventsType1[0], fun1);
};
var fun1 = function () {
AddEvent(document, EventsType2[0], fun2);
};
var fun2 = function () {
setTimeout(function () { $("show").innerHTML = $("txt").value; },1);
};
css
無