How to stop key event in android honeycomb browser?
I want to stop key event at html input.
So I use preventDefault()
to stop keyEvent
.
And it works fine at otherBrowser (iOS, Chrome, Android2.3).
But it doesn't work in Android 3.0 (Honeycomb)
This is my test sample.
<html>
<head>
<title></title>
<script type="text/javascript">
function start( e ) {
var input1 = document.getElementById("input1");
input1.addEventListener("keydown开发者_如何学运维",keydown,false);
input1.addEventListener("keypress",keypress,false);
input1.addEventListener("keyup",keyup,false);
}
function keydown( e ) {
e.preventDefault();
e.returnValue = false;
return false;
}
function keypress( e ) {
e.preventDefault();
e.returnValue = false;
return false;
}
function keyup( e ) {
e.preventDefault();
e.returnValue = false;
return false;
}
window.onload= start;
</script>
</head>
<body>
<input id="input1"></input>
</body>
</html>
Is there something wrong in my testSample?
精彩评论