adding changing color button to css?

  • Unknown's avatar

    Hi I tried to add a javascipt to the css of my blog for a changing background color button but it didn’ t work.
    Is there a possibility to add such a button in photography and if this is the case how does this work?
    Thanks
    The code i added was :
    <script language=”javascript”>
    function chngebck (id)
    {
    switch (id)
    {
    case ‘b1’:
    document.body.bgColor = “black”;
    break;

    case ‘b2’:
    document.body.bgColor = “white”;
    break;

    }
    }
    </script>
    <body>
    <input type=”button” id=”b1″ onclick=”chngebck(this.id)” value=”Button1″/>
    <input type=”button” id=”b2″ onclick=”chngebck(this.id)” value=”Button2″/>

    </body>
    I added it above the <body>.

    The blog I need help with is: (visible only to logged in users)

  • Hi there, it’s not possible to add JavaScript or form code directly to WordPress.com sites for security reasons. You can read more here about the types of code we allow and prohibit.

    Just let me know if you need further help.

  • The topic ‘adding changing color button to css?’ is closed to new replies.