Many people have used style.color, style.display, etc. to directly set the style attributes of elements, but not many people have used style.cssText.
What is the essence of cssText?
The essence of cssText is to set the style attribute value of HTML elements.
How to use cssText?
After reading this example, I believe you also know what style.cssText means. It is to set the style attribute of HTML elements.
What is the return value of cssText?
In some browsers (such as Chrome), whatever value you assign to it will be returned. In IE, it is more painful. It will format the output, capitalize attributes, change the order of attributes, and remove the last semicolon, such as:
The values in IE are: FONT-SIZE: 13px; COLOR: red.