The item() method is used to return the property name of CSS from a CSS declaration block through index.
Parameters: It accepts a single parameter:
- index: It is a required parameter that contains a number which represents the index of the CSS property.
Return Value: It returns the name of the CSS property in the form of the string.
Example: To show the working of the item() method:
Before clicking on the button:
After clicking on the button:
- Google Chrome
- Internet Explorer 9.0
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.