Span with if- urgent!

Hello!
I think I shoudl do sth like:

document.write(if a>10 {} else { } some_text…???

…because I have to change span color regarding to if a is >10 or <10…

many thanks!!!