Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

316
Vistas
How to fill message box on Whatsapp Web?

I'm trying to send a message on Whatsapp Web (https://web.whatsapp.com/) only using Javascript, for study purposes.

Here is the DIV that has the message box :

enter image description here

<div class="fd365im1 to2l77zo bbv8nyr4 mwp4sxku gfz4du6o ag5g9lrv" contenteditable="true" role="textbox" spellcheck="true" title="Type a message" data-tab="10" data-lexical-editor="true" style="user-select: text; white-space: pre-wrap; word-break: break-word;"><p class="selectable-text copyable-text"><br></p></div>

And here is my code :

document.getElementsByClassName('fd365im1 to2l77zo bbv8nyr4 mwp4sxku gfz4du6o ag5g9lrv')[0].innerText = 'My message content';

The code runs without errors, but the message field is not filled, nothing happens on the interface. This code used to run before, but not anymore.

What am i missing ? You can try your self accessing the whatsapp web and using Chrome devtools.

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

you can use

function send_text(text) {
const dataTransfer = new DataTransfer();
dataTransfer.setData('text', text);
const event = new ClipboardEvent('paste', {
      clipboardData: dataTransfer,
      bubbles: true
    });
let el = document.querySelector('#main .copyable-area [contenteditable="true"][role="textbox"]')
el.dispatchEvent(event)
}
send_text("yourText")
about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda