我尝试在bigCommerce结帐页面上预填充值。由于结帐页面使用嵌入式react,这就是为什么我无法使用普通javascript方法更改字段值的原因。不过,我可以使用Document.execCommand()更改值。以下是更改名字的实际代码:
document.getElementById("firstNameInput").focus();
document.execCommand("insertText", false, customerInfo.firstName);
但问题是我无法使用Document.execCommand()从下拉菜单中更改/选择国家。
所以我的问题是,如何使用document.execCommand更改下拉列表的值?
**PS:**我知道document.execCommand已经过时了,但是我现在没有任何替代方法来更改值,因为正如我所说,普通JavaScript方法不会更改bigcommerce结帐页面上的字段值。
1条答案
按热度按时间jhkqcmku1#