我有那个按钮:
<a href="javascript:void(0);" class="allBtn fr logsss_event_cl" id="js_checkoutBtn" data-logsss-const-value="{'x':'checkout'}">Proceed to Checkout</a>
我该怎么推?
答案 0 :(得分:0)
使用javascript,您可以触发点击element.click()
var element = document.querySelector('a#js_checkoutBtn');
element.click()
&#13;
<a onclick="alert('something clicked me')" href="javascript:void(0);" class="allBtn fr logsss_event_cl" id="js_checkoutBtn" data-logsss-const-value="{'x':'checkout'}">Proceed to Checkout</a>
&#13;
要获得正确的element
,您需要更改/将selector作为参数传递给querySelector()