Commonly used attributes in JavaScript include the following:
-
length: Returns the length of a string or array.
-
prototype: The prototype chain used to add properties and methods to objects.
-
constructor: Returns the constructor of the object.
-
window: represents the current window or global object.
-
document: represents the current document object.
-
innerHTML: Set or return HTML content.
-
innerText: Set or return text content.
-
value: Set or return the value of the element.
-
style: used to set the style of the element.
-
className: Sets or returns the class name of the element.
-
id: Set or return the ID of the element.
-
src: Set or return the path of the image or script.
-
href: Set or return the address of the link.
-
name: Sets or returns the name of the element.
-
parentNode: Returns the parent node.
-
childNodes: Returns a collection of child nodes.
-
nextSibling: Returns the next sibling node.
-
previousSibling: Returns the previous sibling node.
-
tagName: Returns the tag name of the element.
-
offsetWidth, offsetHeight: Return the width and height of the element.
These are just some of the commonly used properties, there are many other properties that can be used in JavaScript.