• Resolved lizzydi

    (@lisadix)


    I want to add an onclick event to a button. I added the js code in the individual fields section, but I dont understand, where do I put the keyword CODE?

Viewing 3 replies - 16 through 18 (of 18 total)
  • Plugin Author David Artiss

    (@dartiss)

    Looking at the page source, this is the code that’s appearing…

    <button id="demo">Click me</button>

    As you can see, some of it it missing. I suspect this is WordPress stripping it down, as I believe you’re adding it in a block.

    An alternative suggestion may be to add this as a Code Embed as well. So, as well as CODE3, you might also add a new one, say, called CODE4, with this…

    <button id="demo" onclick="myFunction()">Click me</button>

    Then, in your post, keep wherever you’ve added {{CODE3}} but also add {{CODE4}} somewhere below it, where you want the button to appear. Because none of your code is being added into the editor, it prevents WordPress from modifying it.

    Thread Starter lizzydi

    (@lisadix)

    Unfortunately it’s still happening

    Thread Starter lizzydi

    (@lisadix)

    I have to put everything back to normal now (without the test button). I will try again tomorrow. Thank you very much for your help

Viewing 3 replies - 16 through 18 (of 18 total)
  • You must be logged in to reply to this topic.