This is not really a WordPress specific question, but since WordPress does not provide customization for menu items, I think you’re gonna need this.
You can use .bind()
in jQuery to add an event to user’s click on an specific item. Take a look at this:
jQuery(document).ready(function(){
jQuery( "#menu-item-57" ).bind( "click", function() {
goog_report_conversion ('tel:800-123-4567');
});
});
Change the menu-item-57
to whatever ID of the menu item you want to bind a click event to.
Related Posts:
- Uncaught ReferenceError: ga is not defined
- Detect When User Reads Full Article? [closed]
- Google Tag Manager only load when connected to Admin
- Define a global variable in a JavaScript function
- Can’t bind to ‘ngModel’ since it isn’t a known property of ‘input’
- Cross-Origin Read Blocking (CORB)
- How can I remove a specific item from an array?
- How to use Redirect in the new react-router-dom of Reactjs
- How to fix “Cannot read property ‘addEventListener’ of null” error [duplicate]
- What does [object Object] mean?
- Remove class using jQuery
- How do I check whether a checkbox is checked in jQuery?
- Babel 7 – ReferenceError: regeneratorRuntime is not defined
- How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)
- How can I create a two dimensional array in JavaScript?
- How can I refresh a page with jQuery?
- How can I create a two dimensional array in JavaScript?
- Does JavaScript pass by reference?
- How to add jQuery code into HTML Page
- TypeError: Router.use() requires middleware function but got a Object
- String.prototype.replaceAll() not working
- What does the className attribute mean in JSX?
- How do I check for null values in JavaScript?
- Pure JavaScript: a function like jQuery’s isNumeric()
- jquery SlideToggle effect in upward direction?
- Deleting array elements in JavaScript – delete vs splice
- How can I determine if a variable is ‘undefined’ or ‘null’?
- Cannot find module ‘@angular-devkit/core’
- iFrame onload JavaScript event
- Node.js Error: connect ECONNREFUSED
- How to move an element into another element?
- Is there an arraylist in Javascript?
- How to convert JSON object to JavaScript array?
- How can I display a JavaScript object?
- JSLint says “missing radix parameter”
- Uncaught SyntaxError: Unexpected token :
- How do I check if string contains substring? [duplicate]
- How to move all HTML element children to another parent using JavaScript?
- How to print HTML content on click of a button, but not the page?
- explode string in jquery
- How do I create and read a value from cookie?
- JavaScript – cannot set property of undefined
- Why is this jQuery click function not working?
- Simple average function in Javascript
- How to uncheck a radio button?
- How can I extract a number from a string in JavaScript?
- Angularjs: Error: [ng:areq] Argument ‘HomeController’ is not a function, got undefined
- Truncate a string straight JavaScript
- Phone mask with jQuery and Masked Input Plugin
- Force div to be topmost element of any and all webpages
- moving an element in JS
- Is there a way to get element by XPath using JavaScript in Selenium WebDriver?
- Get class list for element with jQuery
- Object Dump JavaScript
- Print a div content using Jquery
- How can JavaScript save to a local file?
- Generating PDF files with JavaScript
- How to disable auto-start of “Node.js: Server-side JavaScript” when using Adobe Dreamweaver?
- How to disable button in React.js
- “Uncaught TypeError: Illegal invocation” in Chrome
- What are the differences between JSON and JSONP?
- How do I call a JavaScript function on page load?
- Documentation for using JavaScript code inside a PDF file
- WordPress Login Tracking Google Analytics
- Glidejs with WordPress
- REST API: Backbone and custom endpoint
- Gutenberg custom block plugin with custom image sizes
- Check user logged in with JS
- Can I make use of word-count.js in my own code?
- “Password Strength Unknown” Registration Issue
- Linking to Files in Root Directory Outside of WP Installation
- the Customizer – proper way to instantiate an image upload control via javascript
- Using wp_editor in TinyMCE WindowManager dialog
- Gutenberg add extra attributes to custom format
- javascript conflict
- WordPress customizer get control
- How can I use CKEditor with WordPress and let clients edit the content?
- esc_js() breaks unicode sequences by removing the slash ‘\’ character
- How to load JS for specific screen size using wp_enqueue_script?
- I am trying to add current logged in user to my zoho chat
- Video script issue, JavaScript attribute remains ‘undefined’
- Gutenberg getBlockIndex in save() function
- Widgets and Post/Page edit/new blank, console errors only, no server errors
- Why does a on Comment edit page submit the page?
- Where to paste Google Map Snippet / JavaScript / CSS for WordPress integration
- Custom JS text area in customizer is being formatted wrong in document
- TinyMCE Javascript URL Question
- Setting Variable Path to Template Directory inside Script
- Dynamically add Js
- how to prevent added meta box from being injected with style=”position: fixed; top: 56px;” at scroll down
- Contact Form 7 Conditional redirect
- How do i load javascript on a specific custom post template via functions.php?
- How to use value from modal tinymce windowManager?
- Can’t change javascript files
- early enqueueing javascript file in page template, not in functions.php
- Wysiwyg editor not working on 4.2.2
- Remove WordPress default registration client side validation?
- Live Time on WP showing weirdly [closed]
- Google Map JavaScript error after migrating
- Table block variation with header section activated