Skip to main content
adicionou 30 caracteres ao conteúdo
Fonte Link
israel3D
  • 179
  • 2
  • 12

Usa assim o substrig/replace:

$('.mirror').on('keyup', function() {
    var str = $(this).val();
    var resstr = str.replace(".", "");
    var resstr = str.replace(",", ""); //Tu adicionas todos os caracteres que tu queres remover.
    var res = str.replace("#", ""); //Tu adicionas todosE osno caracteresúltimo, quejoga tuna queresvariável remover.'res'
    $("#novoTexto").val(res);
})

<input type="text" class="mirror" placeholder="one">
<input id="novoTexto" type="text" placeholder="two">

Usa assim o substrig/replace:

$('.mirror').on('keyup', function() {
    var str = $(this).val();
    var res = str.replace(".", "");
    var res = str.replace(",", "");
    var res = str.replace("#", ""); //Tu adicionas todos os caracteres que tu queres remover.
    $("#novoTexto").val(res);
})

<input type="text" class="mirror" placeholder="one">
<input id="novoTexto" type="text" placeholder="two">

Usa assim o substrig/replace:

$('.mirror').on('keyup', function() {
    var str = $(this).val();
    str = str.replace(".", "");
    str = str.replace(",", ""); //Tu adicionas todos os caracteres que tu queres remover.
    var res = str.replace("#", ""); //E no último, joga na variável 'res'
    $("#novoTexto").val(res);
})

<input type="text" class="mirror" placeholder="one">
<input id="novoTexto" type="text" placeholder="two">
Mastiguei aí pra ti. Adicionei um "id" e retirei a classe "mirror" no "two".
Fonte Link
israel3D
  • 179
  • 2
  • 12

Usa assim o substrig/replace:

$('.mirror').on('keyup', function() {
    var str = $(this).val();
    var res = str.replace(".", "");
    var res = str.replace(",", "");
    var res = str.replace("#", ""); //Tu adicionas todos os caracteres que tu queres remover.
    $(this"#novoTexto").val(res);
})

<input type="text" class="mirror" placeholder="one">
<input id="novoTexto" type="text" placeholder="two">

Usa assim o substrig/replace:

$('.mirror').on('keyup', function() {
    var str = $(this).val();
    var res = str.replace(".", "");
    $(this).val(res);
})

Usa assim o substrig/replace:

$('.mirror').on('keyup', function() {
    var str = $(this).val();
    var res = str.replace(".", "");
    var res = str.replace(",", "");
    var res = str.replace("#", ""); //Tu adicionas todos os caracteres que tu queres remover.
    $("#novoTexto").val(res);
})

<input type="text" class="mirror" placeholder="one">
<input id="novoTexto" type="text" placeholder="two">
Fonte Link
israel3D
  • 179
  • 2
  • 12

Usa assim o substrig/replace:

$('.mirror').on('keyup', function() {
    var str = $(this).val();
    var res = str.replace(".", "");
    $(this).val(res);
})