0
Good evening, folks. I have a select that lists the cities of the respective state. I’m using this code to select a city from the list:
$('#txtCidades option').removeAttr('selected').filter("[text=São Lourenço da Mata]").attr('selected', "selected").change();
When the text is done by more than one word, I get the following error message:
Uncaught Syntax error, unrecognized Expression: [text=São Lourenço da Mata]
But when the city is composed of only one word, it selects normally without error.
Someone gives a light?
You can join HTML to complete the question?
– Sergio