style
style attribute is consistent with the native one.
Please note that the style attribute can only retrieve the values set on the style attribute itself, not the actual computed styles. Although the style method is similar to the css method, it cannot perform a full style override. Compared to css, the style method has higher internal execution efficiency.
Here is an example demonstrating how to use style:
origin text
logger
Please remember that the style method only gets and sets the values on the style attribute, not the actual computed styles.
Using Template Syntax
You can also use template syntax to style the target element.
I am target