简体   繁体   English

如何将 onclick 添加到 Selz 按钮?

[英]How do I add onclick to a Selz button?

I have a Selz button and am trying to figure out how to add an onclick to it which will call a tracking function, onclick ='myfunction()'我有一个 Selz 按钮,并试图弄清楚如何向它添加一个onclick ,这将调用跟踪 function、 onclick ='myfunction()

I'm at a loss with this particular button.我对这个特殊的按钮不知所措。 I have added the onclick to other links and buttons, but this one baffles me.我已将onclick添加到其他链接和按钮,但这让我感到困惑。 I tried adding the onclick after "Buy The Digital Version" but it did not work.我尝试在“购买数字版”之后添加onclick ,但没有成功。

This is the code for the button:这是按钮的代码:

    <script data-selz-t="_selz-btn-default" data-selz-a="modal" data-selz-checkout="true" data-selz-cb="6699cc" data-selz-chbg="ffffff" data-selz-chtx="000000" data-selz-b="http://selz.co/1234$XYZ" data-text="Buy The Digital Version">
        if (typeof _$elz === "undefined") { var _$elz = {}; }
        if (typeof _$elz.b === "undefined") 
        { 
            _$elz.b = { e: document.createElement("script") }; 
            _$elz.b.e.src = "https://selz.com/embed/button;"; 
            document.body.appendChild(_$elz.b.e);
        }
    </script>

Any assistance is appreciated.任何帮助表示赞赏。

Get the ID or Class of a button from browser in inspect element.从浏览器中的检查元素中获取按钮的 ID 或 Class。 And then with that ID or Class you can add js onclick event.然后使用该 ID 或 Class 您可以添加 js onclick 事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 onclick 值动态添加按钮 - How do I add button dynamically with onclick value 如何在div上单击而不是在按钮上添加/删除div颜色? - How do I add/remove div color onclick of the div but not the button? 如何在Drupal7中单击按钮添加cookie? - How do I add a cookie onclick of a button in Drupal7? 如何切换按钮 onClick 的外观? - How do I switch the appearance of a button onClick? 如何在列表中添加到onclick函数,即<li onclick=“”><button onclick=“”></button></li> - How to add to onclick function inside a list i.e<li onclick=“”><button onclick=“”></button></li> 如何在 javascript 中添加 div onclick? - How do I add a div onclick in javascript? 如何在Java确认框的“确定”按钮中添加onclick事件? - How do I add an onclick event to the OK button of the Javascript confirm box? 如何在 onclick 事件完成后将“按钮”按钮更改为“提交”按钮 onclick 而不提交? - How do I change a “button” button to a “submit” button onclick without submitting after the onclick event is completed? 如何在Javascript中插入可以通过onclick()实现功能的按钮? - How do I insert a button in Javascript that can reach a function with onclick()? 如何使用一些onclick调用功能按钮停止此循环? - How do I stop this loop with some onclick call function button?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM