My question is: from the index.html file below:
<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>
I would like to import the variables str and amount when a button is clicked into a separate server file index.js. Does anyone know how to do so?