[英]i just started JavaScript. i have added jquery library to my html page but this is not working
[英]I have been trying to track Events occurring in my website using JavaScript. But that code is not working
jQuery(document).ready(function() { console.log("function reached"); jQuery("form").submit(function() { analytics.track("Apply Now", { firstName: document.getElementById("header_form_first_name").value, `Help to track firstname by using ID` }); }); });
上面的代碼是我在 WordPress 中的代碼,但它返回 null 值,我不知道為什么它返回 null 值
$(function(){
// Use FORM ID to identify the form and invoke the submit
$('#myForm').submit(function()
{
analytics.track("Apply Now", {
firstName:
document.getElementById("header_form_first_name").value,
`Help to track firstname by using ID`
});
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.