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?