style
The style attribute remains consistent with the native implementation.
Note: the style attribute can only retrieve values explicitly set on it, not the actual computed styles. Although the style method resembles the css method, it cannot perform a full style override. Compared with css, the style method is more efficient internally.
Here is an example demonstrating how to use style:
origin text
logger
Please remember that the style method only gets and sets values on the style attribute, not the actual computed styles.
Template Syntax Usage
You can also use template syntax to set the style of the target element.
I am target