It's almost correct, but you need to translate the names of the CSS properties. Every - in the name gets removed and the next character becomes uppercase, e.g.
font-weight -> fontWeight
And of course you need JavaScript-style assignment, that is
document.getElementById('thediv').style.fontWeight = "bold";


There are far more complicated ways to do other interesting things too, but they don't work in IE so they're usually not interesting.