I have this code that copies everything that is typed in one input to another, I want it to copy to the other input replace special characters, spaces with "-" and lowercase . How could I do as 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">
Example input: Ação Esperada
Expected output: acao-esperada