【发布时间】:2017-02-13 21:53:09
【问题描述】:
所以我的页脚中有一个“快速注册”类型的小部件,只有名字和姓氏文本框。我还有一个按钮,点击后会重定向到实际的注册页面。我的意图是将输入到文本框中的信息带过来,并在注册表单上填写匹配的名字/姓氏文本框。
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 textbox storage