Good evening, everyone. 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 made up of 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 consists of only one word, it normally selects without error.
Does anyone give a light?