I don't really see your problem, but you can test it with an alert, so:-
Code:
numcheck = /\d/;
var x = !numcheck.test(keychar);
alert (x);
return x;
}
The return statement specifies the value to be returned by a function or event handler and performs the act of returning that value to where the function was called from.
The value returned is either true or false, depending on the evaluation of the regular expression numcheck = /\d/; and then !numcheck.test(keychar); This could have been simplified to var x = (!/\d/.test(keychar)); Meaning - test the value of keychar for the presence of a digit (true or false) - and reverse the result false/true. If the result is false (a number was found) then the normal action of the keypress is suppressed or cancelled.
All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.