Изменение CSS с помощью JavaScript

Чистый JavaScript

var el = document.getElementById("element");
el.style.opacity = 0.5;
el.style.fontFamily = 'sans-serif';

Изменение CSS с помощью jQuery

// Modifying CSS properties with jQuery is even simpler.

$('#element').css('margin', '5px');

// If you need to change more than one style rule:

    margin: "5px",
    padding: "10px",
    color: "black"

// jQuery includes two ways to change css rules
// that have hyphens in them (i.e. font-size ).
// You can put them in quotes or camel-case the style rule name.

    "background-color": "blue",
    fontSize: "10px"
JavaScriptCSS JavaScriptCSS