Was*_* A. 10 javascript-events onkeypress
function h(x)
{
alert(x);
}
<input onkeypress=h(this.value) type=text>
Run Code Online (Sandbox Code Playgroud)
当我
在'a'='ab'之后按'b' 时按'a'警告为空时只有'a'我想要'ab'而
当我输入'abcd'时我想要'ab '它只警告'abc'而我想要'abcd'
Was*_* A. -2
var unicode=e.keyCode? e.keyCode : e.charCode;
typing = document.getElementById('textbox').value + String.fromCharCode(unicode);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7762 次 |
| 最近记录: |