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

Solved divi code module doesn't work for audio play

Discussion in 'Free Divi Community Forum' started by automenu7, Apr 23, 2020.

  1. automenu7

    automenu7 New Member

    Hello Divi experts,

    I tried to add the below code using a divi code module on the divi builder. However, when I click the button, it doesn't play a beep sound and the plain text that is exactly the same as the code is displayed. I confirmed this shortcode works. So, could you help me to solve this problem? All in the Divi theme options>integration are enabled.

    -----------------------------------------------------------------------
    <audio id="ga"> </audio>
    <button onclick="PlaySound()"> Ga </button>

    <script>
    var bflat = new Audio();
    bflat.src = "http://www.soundjay.com/button/beep-07.wav";
    function PlaySound() {
    bflat.play();
    }
    </script>
    ------------------------------------------------------------------------------

    Thanks a lot in advance.
     
    1. PRO MEMBER PERKS Beautifully crafted custom colored 'Digital Marketing' Divi layout for all Pro members:View Demo
  2. Divi.Help

    Divi.Help Administrator
    Staff Member

    I tried adding a new code module & pasted the code below:
    Code:
    Log In or Sign Up to view this code.
    And I got the below button on my page & upon clicking it, it did 'beep'.

    upload_2020-4-23_19-30-22.png
     
  3. automenu7

    automenu7 New Member

    Hi Divi.Help

    I tried several times with a new code module and the above code (copy & paste) in your answer again. But it didn't work. When I clicked the "Ga" button, it just displayed the plain text of code. As you know, it's not the problem of the code. Is there anything in the divi setup or any suggestion that I have to check to run this code?

    I appreciate your help a lot.
     
    1. PRO MEMBER PERKS Divi Block Pro - 30+ premade custom header designs for you to choose from:View Demo
  4. Divi.Help

    Divi.Help Administrator
    Staff Member

    Kindly share your URL.
     
  5. automenu7

    automenu7 New Member

    Hi Divi.Help,

    I'm not sure what happened but while I have checked options, the code began to work.

    So sorry for bothering you and thank you so much for your help.
     
    1. PRO MEMBER PERKS Divi Block Pro - Premade gradient text design for your Divi site without using any plugins:View Demo