why are initial CSS styles not visible on DOM element .style field?
问题 OK I have full expectation of going down in flames for asking something stupid (or at least duplicate), but in the attached snippet, why do I have to use window.getComputedStyle to access styles applied by CSS? I was under the impression that the .style field would at least reflect those styles initially applied by CSS, and/or manually changed since then. If not, what are the exact rules governing which properties are reflected (and when) in an element's .style field? setTimeout(() => {