So MANY ways to do this!

Besides what has already been shown:

Code:

function evenorodd(which)
{
var x = parseInt(which);
if( isNaN(x) || x == "" )
{
alert( "Not a number or no value entered" );
return false;
}
alert( x + [" is even"," is odd"][x % 2] );
alert( x + [" is even"," is odd"][x & 1] );
alert( x + ( ((x >> 1) << 1) == x ? " is even" : " is odd" ) );
alert( x + ( Math.floor(x / 2) * 2 == x ? " is even" : " is odd" ) );
}

Though I admit that the middle 2 there probably only work if Math.abs(x) < Math.pow(2,31).

And there are other ways.