I'm having a question in comparing string using Javascript / jQuery.
I want the city in input id="cidade"
not to be Goiânia
or Aparecida de Goiânia
to display the
alert
.
But even when the city is Goiânia
alert
is being displayed. As the example below, I have already set the value manually as Goiânia
for tests.
$( "#botao" ).click(function() {
var verificarcidade = $('#cidade').val();
if (verificarcidade != 'Goiânia' || verificarcidade != 'Aparecida de Goiânia' ){
alert('Parar');
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><inputid="cidade" type="text" value="Goiânia" required />
<a href="#" id="botao" role="button">Calcular</a>