gpt4 book ai didi

javascript - 无法通过 JavaScript 模拟点击提交按钮

转载 作者:行者123 更新时间:2023-11-28 06:47:26 24 4
gpt4 key购买 nike

我在通过 JavaScript 在 mailchimp 弹出订阅表单上模拟点击时遇到问题,我需要您的帮助。

    <!-- Title & Description - Holds HTML from CK editor -->
<div class="content__titleDescription" data-dojo-attach-point="descriptionContainer"><strong>Unlock the content </strong>by subscribing to our page.</div>

<!-- Form Fields -->
<form action="//mc.us7.list-manage.com/subscribe/form-post?u=bcd9828fa83ea7a231ffbee26&amp;id=1928481ac4" accept-charset="UTF-8" method="post" enctype="multipart/form-data" data-dojo-attach-point="formNode" novalidate="">
<div class="content__formFields" data-dojo-attach-point="formFieldsContainer">
<div class="field-wrapper" id="uniqName_3_0" widgetid="uniqName_3_0">
<label for="mc-EMAIL">Email Address</label>
<input type="text" name="EMAIL" value="" id="mc-EMAIL" class="invalid">
<div class="invalid-error" style="display: block;">This field is required.</div>
</div>
<div class="field-wrapper" id="uniqName_3_1" widgetid="uniqName_3_1">
<label for="mc-FNAME">First Name</label>
<input type="text" name="FNAME" value="" id="mc-FNAME" class="valid">
<div class="invalid-error" style="display: none;"></div>
</div>
<div style="position:absolute;left:-5000px;">
<input type="text" name="b_bcd9828fa83ea7a231ffbee26_1928481ac4" tabindex="-1" value="">
</div>
</div>
<div class="content__button">
<input class="button" type="submit" value="Subscribe" data-dojo-attach-point="submitButton">
</div>
</form>

<!-- Footer - Holds HTML from CK editor -->
<div class="content__footer" data-dojo-attach-point="footerContainer"></div>
</div>
<div class="modalContent__image" data-dojo-attach-point="formImageContainer"></div>

我尝试定位的代码是:

    <input class="button" type="submit" value="Subscribe" data-dojo-attach-point="submitButton">

这是提交按钮“订阅”,您也可以在中看到

http://www.aspeagro.com/EN_Program_Abricot.html

谢谢!

最佳答案

这个怎么样?我认为应该做你想做的事?

HTML

<input id="submit-button" class="button" type="submit" value="Subscribe" data-dojo-attach-point="submitButton">

JS

$('#submit-button').on('click', function(e){

e.preventDefault();
// Do what you want to do
});

关于javascript - 无法通过 JavaScript 模拟点击提交按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33289495/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com