Thursday, 22 August 2013

How can i if function with value?

How can i if function with value?

My function
function Random() {
var length = 6,
charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
retVal = "";
for (var i = 0, n = charset.length; i < length; ++i) {
retVal += charset.charAt(Math.floor(Math.random() * n));
}
return retVal;
}
I want like this if but does not work I want to make them equal but i
couldn't thanks
$('#rand').bind('keypress keyup change', function () {
if ($(this).val() !== Random()) { //etc }
});

No comments:

Post a Comment