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

150
Vistas
How to create dom elements with javascript?
over 4 years ago · Alberto de Jesus Carcamo Nazar
1 Respuestas
Responde la pregunta

1

Using the .createElement() method we can create an HTML in memory ( it won't be embedded in our HTML document yet! ). With said element stored in a variable, we can modify its characteristics or content, to later insert it in a certain position of the DOM or HTML document.

For example:

 const myDiv = document.createElement("div"); myDiv.innerText = "Hello World"; myScript.id = "custom-script"

This will create an element in memory called myScript that has as text the HTML paragraph "Hello World" and to insert it to the DOM or HTML document is as follows:

 document.body.appendChild(myScript);

This will insert it into the body of your application's HTML document.

over 4 years ago · Santiago Trujillo 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