What's the difference between element.style and getComputedStyle(element)?
The key difference is that element.style only shows inline styles (those set directly on the element's style attribute), while getComputedStyle(element) shows all applied styles including those from CSS stylesheets, inherited styles, and default browser styles. Additionally, getComputedStyle returns the final calculated values in pixels for relative units, making it useful for getting exact dimensions and positions.