Check select box values and compare them with an input
<p>I would like to check if a textfield, newTeamName is already in a list of teamnames stored in a select box. Unfortunately, my code does not work - what's wrong with it? Oh and I have no console problems.</p>

<pre><code>    optionList = [];
    $('#chooseTeam option').each(function() {
        optionList.push($(this).val())
    });
    if (form.newTeamName.value in optionList) {
        $("#text-error").html("Team exists");
        $('#text-error').fadeIn(400).delay(3200).fadeOut(800);
        return false;
    }
</code></pre>

<p>Small Update:</p>

<p>Oh and my form.name.value's work fine as they work for other if statements.</p>
