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

151
Views
reemplace document.getElementbyId ("id") con solo id

Parece que este código está funcionando bien. Pruébalo antes de responder:

 <!DOCTYPE html> <html> <body> <h2>JavaScript Variables</h2> <p>In this example, x, y, and z are variables.</p> <p id="demo"></p> <script> let x = 7; let y = 45; let z = x + y; demo.innerHTML = "The value of z is: " + z;//please note this line </script> </body> </html>

¿Significa esto que puedo reemplazar document.getElementById("id"). con solo DNI???

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

0

Está funcionando, pero se considera heredado e inseguro.

about 4 years ago · Juan Pablo Isaza Report

0

Parece que sí, y también funciona para elementos anidados... Sin embargo, me pregunto si funciona en un archivo js diferente importado del html.

 <!DOCTYPE html> <html> <body> <h2>JavaScript Variables</h2> <p>In this example, x, y, and z are variables.</p> <p id="demo1"> <p id="demo2"></p> </p> <p id="demo"></p> <script> let x = 7; let y = 45; let z = x + y; demo.innerHTML = "The value of z is: " + z;//please note this line demo2.innerHTML = "The value of z is: " + z;//please note this line console.log(demo); </script> </body> </html>

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!