compare jquery val VS array value
<p>I need to compare 2 values. One value comes from input box, the other one is in an array.</p>

<pre><code>    var caja = $("#txtRespuesta").val();
    alert("Comprueba respuesta: " + caja);
    $("#puntos").text(puntos); 
    var obj2String = (arregloDePhp[indiceArregloPhp]).toString();
    // if (res2.equals(obj2String.toString())){ //complains that object has no method .equals
     if (caja==obj2String){ 
    puntos+=1; 
    };
    console.log ("comparing: "+caja+" y "+obj2String);//actually this shows both words are the same
    indiceArregloPhp+=1;
</code></pre>

<p>Can't find what is it, please point me out in the right direction.</p>

<p>Thanks in advance.</p>
