document.getElementById(\'myId\').style;
is one way of accessing the style attribute..
Also we can do the same using
document.getElementById
there is no difference.
document.getElementById('myId').style;
is a shorthand for
document.getElementById('myId').getAttribute('style');
the only use for getAttribute('attributeName') would be if attributeName is not a valid javascript variable name, so encapsulating it in quotes would be the only way to access it.