Home>Article>Web Front-end> What does style mean in JavaScript?
Style in JavaScript means "style" and "setting style". The style attribute is a global attribute. You can change or set the style of an element in JavaScript. The syntax is "element object.style.style attribute = "Style attribute value ";".
The operating environment of this tutorial: Windows 10 system, JavaScript version 1.8.5, Dell G3 computer.
What does style mean in JavaScript
Style in JavaScript means style, setting style.
Style object represents a single style declaration. A Style object can be accessed from the document or element to which the style is applied.
The syntax is:
document.getElementById("id").style.property="值"
In many cases, it is necessary to dynamically modify the styles of elements on the web page. Provides methods for dynamically modifying styles in JavaScript.
The example is as follows:
Document 无序列表:
Output result:
##[Related recommendations:The above is the detailed content of What does style mean in JavaScript?. For more information, please follow other related articles on the PHP Chinese website!