Brief explanation about some terms

  • Method: A method is a function that is associated with an object in JavaScript. Methods can be used to perform actions on the object or retrieve information from the object. For example, the getElementById method is a method that is associated with the document object and is used to retrieve an HTML element from the DOM.

  • Element: An element is an object in the DOM that represents an HTML tag. Elements can have properties (such as textContent and className) and can be modified using methods (such as setAttribute and appendChild). Examples of elements include <div>, <p>, and <img> tags.

  • Properties: In JavaScript, properties are values associated with an object. Elements in the DOM are objects and have properties such as textContent, className, and id. Properties can be accessed and modified using dot notation, such as element.textContent = 'Hello World';.

  • Attribute: An attribute is a value that is associated with an HTML tag. Attributes are used to provide additional information about an element, such as the src attribute on an <img> tag. Attributes can be accessed and modified using methods such as getAttribute and setAttribute.

Last updated