所以我有一個「快速註冊」類小部件在我的頁腳中只有名字和姓氏文本框。我也有一個按鈕,點擊後重定向到實際的註冊頁面。我的意圖是將輸入的信息輸入到文本框中,並在註冊表中填寫匹配的第一個/最後一個名稱文本框。如何存儲文本框的值以便以後使用Javascript?
document.querySelector(".footerSignUp").onclick = function() {
var footerFirst = document.querySelector(".footerFirstName").value;
var footerLast = document.querySelector(".footerLastName").value;
alert(footerFirst,footerLast);
location.href = " http://localhost/wordpress/my-account/register/ ";
};
<input type="text" class="input-text footerFirstName" name="billing_first_name" value="Firstname" />
<input type="text" class="input-text footerLastName" name="billing_last_name" value="Lastname" />
<input type="button" value="Sign-up" class="footerSignUp" />
感謝
可能重複[如何在javascript中的不同html頁面之間傳遞變量值](http://stackoverflow.com/questions/23213788/how-to-pass-variable-value-between-different-html-pages- in-javascript) – Turnip