validation using while and indexof()

Very new to Javascript and am having a slight problem with the following;

I am asking a user to input either Red, Blue or Yellow. the while loop should check the input against my constant, if the input does not match, then it reprompts. At the state of it at the moment, the script is not working what so ever. All I am trying to achieve is checking the user prompt against the constant and reprompting if no match is found


    userInput = (prompt(message));

    while (VALID_LIST.indexof(userInput)) = -1 {
    alert('Your input was invalid');
    userInput = (prompt(message));

I have been trying loads of different things to get this to work, just wondering if anyone can shed some light onto what I am doing wrong?