1
I’m having trouble treating stress in jQuery.
I would like to remove word accents and replace spaces with "%20". I tried to do it the way down, but it didn’t work.
cidade_sem_tratar = $('#estados').val();
console.log(cidade_sem_tratar);
cidade_tratada = cidade_sem_tratar
.replace(/[áàâã]/,'a')
.replace(/[éèê]/,'e')
.replace(/[óòôõ]/,'o')
.replace(/[úùû]/,'u')
.replace(' ','%20');
console.log(cidade_tratada);
The result is as follows:
Please, could you help me?
Hug and Thanks!
Good morning! Why not paste the code in the question instead of print? So we could copy and try to play.
– Sam
Seems to have no problem with your code
– BrTkCa