A problem with a button

  • Unknown's avatar

    Hello there,

    I’m currently encoutering a problem with button code, using personnalised html.

    What i’m trying to do : reveal an element of a page using the onClick attribute + javascript :

    <button type="button" style="background-color:#ffffff;color:black;border:2px solid black;border-radius:5px;padding:10px;margin:20px;font-size:130%" onclick="document.getElementById('calend3').style.display='block'">G33</button></code>

    The problem is, the preview from html provide the right output (button with its design and fonctionnality) but when I update the page, and check from the client-side (read) I only see the text of the button (“G33”), without any design nor fonctionnality. Needless to say, it’s useless like that.

    I tried using the button block from Jetpack, but it only allows link (hypertext) which is not very convenient.

    Do you have any ideas on how to solve this ?

    Thanks in advance !

  • Hi there,

    Are you working on https://lapromodesamuelpremier.wordpress.com/? Adding JavaScript code is not allowed on WordPress.com sites for security reasons, so you won’t be able to use that code on this site.

    Add Code to Your Site

    Using JavaScript code inside posts and pages is only possible on our Business Plan.

  • Unknown's avatar

    Yep that’s it! I was suspecting that, thank you!
    Aaaand it was on the website already, I didn’t thought about searching in this section x)
    Thank you Sir, have a good day!

  • The topic ‘A problem with a button’ is closed to new replies.