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

203
Vistas
Trying to change Speech bubble text when User submits name input

I have 2 javascript files.

js file 1 contains the time delay for a speech bubble to appear with animation

see js file 1 code

let bubble = document.getElementById("speach-bubble");
let noDisplay; bubble.style.display ="none";

const delay = setTimeout(bubbleAnimate,1500)

function bubbleAnimate()
{
    noDisplay = bubble.style.display ="block";
    bubble.style.animation="slidein 0.5s 1";
}

with js file 2 I am trying to make a function that when user clicks submit after typing in their name the speech bubble changes to "welcome to your to-do App" + name

this is what I have so far

let welcome ="Welcome to your To-Do App"

windows.onload = function()
{
    document.getElementById("userName").onsubmit = function()
    {
        let text = document.getElementById("nameId");
        let changebox = document.getElementById("speach-bubble").innerHTML = welcome + " " + text;
    }
}

this is the elements I am working on within my HTML file

 <div class=container>
        <div class= base>
            <div class = screen>
                <img src="images/WarGreymon_Render.png" alt="Wargreymon">
                <div id ="speach-bubble"> What is your 
                    name?
                <div id = "bubble-text">
                </div>
                </div>
            </div>
            <div class = "nameInput">
                <form id ="userName">
                <input type="text" id ="nameId" name="name" placeholder="Type your name here...">
                <input type="submit" id ="submit" value="Submit">
            </form>
           
            </div>
        </div>

is there a way to link js file 1 to js file 2 so that I can influence the speech bubble after userinput has been submitted.

about 4 years ago · Juan Pablo Isaza
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