Onkeypress event not working in opera mini

Is there any way by which I can enable onkeypress event in opera mini for mobile? It works in almost all browsers, but not in Opera Mini.

My code is:

<pre> <script type="text/javascript"> function doCheck(field) { if (isNaN(document.getElementById(field).value)) { alert('This is not a number! Please enter a valid number before submitting the form.'); document.getElementById(field).focus(); document.getElementById(field).select(); return false; }else { return true; } } function abc(){ var a; a = document.getElementById('inp').value; if(isNaN(a)){ alert("you can write only numbers"); document.getElementById('inp').value = ""; } } </script> </pre> 
+4
source share
1 answer

as far as I know, Opera Mini has limited JS support (and onKeyPress not one of them)

+2
source

Source: https://habr.com/ru/post/1402602/


All Articles