1. PROMO Subscribe our All Access Pass @ 75% OFF & access all our 16+ premium Divi extensions: Divi Block Pro, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Javascript on custom button in menu

Discussion in 'Free Divi Community Forum' started by Archie, Nov 9, 2022.

  1. Archie

    Archie New Member

    I have a website that is calling up a third party plugin, I have created a menu button and given it a class.
    Then clicking the button nothing happens, the script is installed and the javascript for the action is

    <script type="text/javascript">
    jQuery(".reciteme").click(function(i,e){
    loadService();
    return false;
    });
    </script>

    So I have created the following on the button:
    <script>
    jQuery(function($){
    $("#divi-life-cta-menu").click(function(e){
    e.preventDefault();
    // <script type="text/javascript">
    jQuery(".reciteme").click(function(i,e){
    loadService();
    return false;
    });
    </script>

    It doesn't work though :/
     
    1. PRO MEMBER PERKS Divi Block Pro - Premade slide in bar design for your Divi site without using any plugins:View Demo