Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

128
Views
Javascript [ documento.escribir ("___"); ] Atajo para no comenzar cada línea con document.write ("

En este código, quiero insertar algo de HTML y texto normal en JavaScript y no quiero que siempre ingrese document.write(" al comienzo de cada línea como:

 document.write("some text some text some text");

En lugar de esto:

 document.write("Hello World!"); document.write("Have a nice day!"); document.write("<br>"); document.write("<p>some random paragraph"); 

 document.write("Hello World!"); document.write("Have a nice day!"); document.write("<br>"); document.write("<p>some random paragraph");

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

  1. No use document.write :

⚠ Advertencia: Se desaconseja encarecidamente el uso del método document.write().

  1. Use una plantilla/cadena para crear el HTML y luego innerHTML al HTML interno del cuerpo del documento (o cualquier elemento que desee).

 document.body.innerHTML = ` Hello World!<br /> Have a nice day!<br /> <p>some random paragraph</p> `;

about 4 years ago · Juan Pablo Isaza Report

0

⚠Advertencia: no utilice document.write


En su lugar, utilice document.body.innerHTML = '';

 document.body.innerHTML = ` your text <br> your text `;

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!