title: Empty AlertController Input - Ionic
body: <p>I want to empty an alert input if the user tried to paste a string in the textbox. This is my code:</p>
  
  <pre><code>openManualEdit () {
    let myAlert = this.alertCtrl.create({
        title: 'Ingreso Manual',
        message: 'Ingresa el código de barra en los campos debajo.',
        inputs: [
          {
            name: 'serial',
            placeholder: 'Número de serie',
            id: 'txtSerial'
          },
          {
            name: 'serial_confirm',
            placeholder: 'Confirma el número de serie',
            id: 'txtSerialConfirm'
          }
        ],
        buttons: [
          {
            text: 'Cancel'
          },
          {
            text: 'Continue',
            handler: (data) =&gt; {
              console.log(data);
          }
        }
      ]
    });
    myAlert.present().then(() =&gt; {
      // Empty textbox if user tries to paste
      document.getElementById('txtSerial').addEventListener('paste', function (event) {
        console.log(event);
        (&lt;HTMLInputElement&gt;event.target).value = '';
      });
  
   // Empty textbox if user tries to paste
   document.getElementById('txtSerialConfirm').addEventListener('paste', function (event) {
        // console.log(event);
        (&lt;HTMLInputElement&gt;event.target).value = '';
      });
    });
  }
  </code></pre>
  
  <p>So far I'm detecting the paste event, but the code to empty the textbox isn't working. I've also tried using:</p>
  
  <ul>
  <li>document.getElementById('txtSerial').value = '';</li>
  <li>document.getElementById('txtSerial')["value"] = '';</li>
  <li>event.srcElement["value"] = '";</li>
  </ul>
  
  <p>But none of these seem to work. Any help is greatly appreciated.</p>