I'm having trouble handling accentuation in jQuery.
I would like to remove accents from words and replace spaces with "% 20". I tried to do it the way it did, though, it did not 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:
Could you please help me?
Hug and Thanks!