$(document).ready(function(){
$(".param").keypress(function(event){
var inputValue = event.which;
// allow numbers only.
if(inputValue > 47 && inputValue < 58) {
event.preventDefault();
}
});
});
$(document).ready(function($){
$('body').on('keypress', function (e) {
console.log('I have been pressed', e);
})
});
var code = (e.keyCode ? e.keyCode : e.which);
if(code > 47 && code < 58) { //Enter keycode
e.preventDefault();
}
$("form").bind("keypress", function (e) {
if (e.keyCode == 13) {
$("#btnSearch").attr('value');
//add more buttons here
return false;
}
});
$(".text").on('keypress', function(e){
alert(e.keyCode);
if (e.keyCode > 47 && e.keyCode < 58) {
return false;
}
});
document.querySelector("input").addEventListener("keypress", function (evt) {
if (evt.which < 48 || evt.which > 57)
{
evt.preventDefault();
}
});
document.querySelector(".sign").addEventListener("keypress", function (evt) {
if (evt.which < 48 || evt.which > 57)
{
evt.preventDefault();
}
});