日期:2014-05-16 浏览次数:20592 次
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript">
function test(){
if(event.keyCode==220){
alert("触发\斜杠键");
}
}
</script>
<title>test</title>
</head>
<body>
<input id="abc" onkeydown="test();">
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript">
function test(obj){
if(event.keyCode==220){
obj.value = obj.value.substring(0,obj.value.length -1);
}
}
</script>
<title>test</title>
</head>
<body>
<input id="abc" onkeyup ="test(this);">
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>test</title>
<script type="text/javascript">
function test(ev){
ev = ev
------解决方案--------------------