CSS Styles from a select box

    Date: 12/01/07 (Javascript Community)    Keywords: css, java

    Hello, I'm trying to setup a form so that the CSS styles can be chosen from select boxes. I want to have a font-family select box so that when an option is selected, the CSS in the page changes to that style. I would like to change the color, background-color, font-size and font-family this way.

    I tried a simple bit of code but it doesn't work and I'm not that good with javascript to understand why, can anyone help?

    function ChangeBodyBGColor()
    {
    document.body.style.background-color=document.success.bgcolor.options[document.success.bgcolor.selectedIndex].value
    }


    Source: http://community.livejournal.com/javascript/147363.html

« Back-Forward. My way || Javascript/CSS issue on Win IE »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home