2
I have this code that copies everything you type into one input to another, I want when it copies to the other input replace special characters, spaces with "-" and minute letters. How could I do like jquery?
$('.mirror').on('keyup', function() {
$('.'+$(this).attr('class')).val($(this).val());
})
<input type="text" class="mirror" placeholder="one">
<input type="text" class="mirror" placeholder="two">
Input example: Ação Esperada
Expected exit: acao-esperada
Have you tried using the
str.replace
javascript?– Woss
$('.mirror'). on('keyup', Function() { $str.replace(('. '+$(this). attr('class')). val($(this). val()); });
– Wagner Martins Bodyboard
You want to replace such characters with what? Yours
replace
doesn’t seem to make sense. Have you read the documentation of function?– Woss
You can give an example of the text you want to replace and how it should look?
– Sergio
Expected action expected action
– Wagner Martins Bodyboard