Prop Cssstyle Length
# CSSStyleDeclaration length property
[ CSS CSSStyleDeclaration](#)
## Example
Return the number of style declarations for the h1 element:
var elmnt = document.getElementsByTagName("h1"); var x = style.length;
[Try it Yourself Β»](#)
* * *
## Definition and Usage
The length property returns the number of style declarations for the specified element.
* * *
## Browser Support
| Property | | | | | |
| --- | --- | --- | --- | --- | --- |
| length | Yes | Yes | Yes | Yes | Yes |
* * *
## Syntax
Return the length property:
element.style.length
* * *
## Technical Details
| DOM Version: | CSS Object Model |
| --- |
| Return Value: | An integer representing the number of CSS declarations |
* * *
## More Examples
## Example
Loop through and output the names of all inline CSS properties for the specified element:
for(i = 0; i<elmnt.style.length; i++){txt += elmnt.style.item(i)}
[Try it Yourself Β»](#)
[ CSS CSSStyleDeclaration](#)
YouTip