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

200
Views
¿Es posible importar valores de un index.html a un archivo .js? (usando el paquete js)

Mi pregunta es: del archivo index.html a continuación:

 <html> <body> <div id="account"></div> <script type = "module" script src="./index.js"></script> <link rel="stylesheet" href="./index.scss"> <div class="send"> <h1> Send VeggieToken </h1> <input id="Amount" placeholder="Send Amount" /> <br> <input id="recipient" placeholder="Enter Recipient" /> <br> <button onclick="fn1()" id = "btn1">Transfer</button> <br> </div> </div> </div> </body> <script> function fn1(){ var str = document.getElementById("recipient").value; var amount = document.getElementById("Amount").value; alert("Transferred Amount:" + amount); } </script> </html>

Me gustaría importar las variables str y cantidad cuando se hace clic en un botón en un archivo de servidor separado index.js. ¿Alguien sabe cómo hacerlo?

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