Basically, JavaScript CSS applying is used when we want to apply CSS on the behalf of decision . E.g If value is less than 10 color should be red . etc
document.getElementById(idvalue).style.propertyName = Style Value;
Note . The CSS property name will change in some cases by following technique:
<script type="text/javascript">
document.getElementById('myparagraph').style.fontSize='30px';
</script>
<p id="myparagraph">The small courtesies sweeten life the greater ennoble it.</p>
<script type="text/javascript">
document.getElementById('myparagraph').style.fontSize='30px';
document.getElementById('myparagraph').style.color='white';
document.getElementById('myparagraph').style.background='gray';
document.getElementById('myparagraph').style.padding='5px';
document.getElementById('myparagraph').style.borderBottom='2px dashed red';
</script>
The small courtesies sweeten life the greater ennoble it.