DOM data
Document Object Model - Wikipedia

DOM data

The Document Object Model (DOM) is a programming interface for web documents. It represents the structure of an HTML or XML document as a tree-like structure, where each node in the tree corresponds to an element or attribute in the document. You can access and manipulate various types of information from the DOM.

The exact element attributes are those that are specific to a particular element. For example, the href attribute is an exact element attribute for <a> elements.

Knowing the exact element attributes can be helpful when working with the DOM, as it allows you to access and manipulate the elements more precisely.

Here's a list of information that is possible to get from the DOM and some additional details about each of the elements.

  1. Element Attributes:

  • Tag name: The tag name is the name of the HTML element. For example, the tag name for a paragraph element is <p>.
  • ID: The ID is a unique identifier for the element.
  • Class name: The class name is a way to group elements together.
  • Data attributes: Data attributes are custom attributes that can be used to store additional information about the element.
  • Inline styles: Inline styles are styles that are applied to an element directly in the HTML code.
  • Input values: Input values are the values that are entered into input elements, such as text boxes and radio buttons.
  • Element properties (e.g., innerText, innerHTML, textContent): Element properties are attributes that are specific to a particular element. For example, the innerText property of a text element is the text content of the element.

  1. Node Hierarchy:

A node hierarchy is a tree-like structure where each node has one or more child nodes.

  • Parent node. The parent node is the node that directly precedes a child node.
  • Child nodes. Child nodes are nodes that are directly preceded by a parent node.
  • Sibling nodes. Sibling nodes are nodes that have the same parent node.
  • Ancestors. Ancestors are nodes that are directly or indirectly preceded by a given node.
  • Descendants. Descendants are nodes that are directly or indirectly preceded by a given node.

  1. DOM Tree Structure:

  • Document structure and hierarchy. The DOM tree structure is a hierarchical representation of the document. The root node of the tree is the document itself, and the child nodes of the root node are the elements of the document.
  • Node types (e.g., element nodes, text nodes, comment nodes). The node types in the DOM tree are element nodes, text nodes, comment nodes, and processing instruction nodes. Element nodes represent HTML elements, text nodes represent text content, comment nodes represent comments, and processing instruction nodes represent processing instructions.

4 Event Handling:

  • Event listeners attached to elements. Event listeners attached to elements: Event listeners are JavaScript functions that are attached to HTML elements. When an event occurs on an element, the event listener is called.
  • Supported events for an element. The supported events for an element are the events that can be listened for on that element. The supported events for an element vary depending on the element.Here are some examples of event listeners and supported events:The click event is a supported event for the button element. When a user clicks on a button, the click event is triggered.The mouseover event is a supported event for the div element. When a user's mouse moves over a div element, the mouseover event is triggered.The keydown event is a supported event for the input element. When a user presses a key on the keyboard while an input element is focused, the keydown event is triggered.

  1. Styles and Layout:

  • Computed styles (e.g., color, font-size) are the final styles that are applied to an element, after all of the rules from the style sheet and the browser's default styles have been applied. This includes properties such as color, font-size, and margin.
  • Layout information (position, dimensions) refers to the position and dimensions of an element on the page. This is determined by the element's CSS properties, such as position, width, and height.
  • CSS classes applied to elements are a way to group together related styles. This can be useful for applying the same styles to multiple elements, or for creating reusable style blocks.Here is a more detailed explanation of each of these terms:Computed styles are calculated by the browser based on the style sheet rules and the browser's default styles. The style sheet rules are applied in order, and the browser's default styles are applied last. The final styles are then applied to the element.Layout information is determined by the element's CSS properties, such as position, width, and height. The position property specifies the element's position on the page, relative to its parent element. The width and height properties specify the element's dimensions.CSS classes are a way to group together related styles. This can be useful for applying the same styles to multiple elements, or for creating reusable style blocks. To apply a CSS class to an element, you add the class name to the element's class attribute.

  1. Form Data:

  • Form elements (input, select, textarea)
  • Form values (user input)
  • Form submission and handlingHere are some additional details.The different types of form elements and how they are used to collect different types of data.The importance of validation is to ensure that form data is entered correctly.The different ways to submit form data, such as using the submit button or the Enter key.The different methods for handling form data on the server, such as using PHP, JavaScript, or Python.

  1. Manipulation and Modification:

  • Creating, deleting, or modifying elements: HTML elements can be created, deleted, or modified using JavaScript. For example, you can use the document.createElement() method to create a new element, the document.removeChild() method to delete an element, and the document.querySelector() method to select an element and then modify its properties or content.
  • Changing attributes and content: The attributes and content of HTML elements can be changed using JavaScript. For example, you can use the element.setAttribute() method to change an element's attribute, and the element.textContent property to change the element's content.
  • Appending, inserting, or removing nodes: Nodes can be appended, inserted, or removed from the DOM using JavaScript. For example, you can use the document.appendChild() method to append a node to the DOM, the document.insertBefore() method to insert a node before another node, and the document.removeChild() method to remove a node from the DOM.

8. Navigation:

  • Traversing the DOM tree (parent, children, siblings) is the process of moving through the hierarchical structure of a document object model (DOM). This can be done using the parent, children, and siblings properties of the DOM element.
  • Finding elements by various criteria (tag name, class, ID) is the process of locating an element in the DOM tree based on its tag name, class, ID, or other attributes. This can be done using the querySelector() and querySelectorAll() methods of the document object.

Here are some additional details.

The DOM tree is a hierarchical representation of an HTML document. It is made up of nodes, which represent different parts of the document, such as elements, text nodes, and comments.

The parent property of an element refers to the element that contains it. The children's property of an element refers to the elements that are contained within it. The sibling's property of an element refers to the elements that are at the same level as it is in the DOM tree.

The querySelector() method of the document object can be used to select an element by its tag name, class, ID, or other attributes. The querySelectorAll() method can be used to select all elements that match a given criteria.

  1. DOM Information:

  • Document metadata (title, language, character set) is information about the document, such as its title, language, and character set. This information can be found in the DOM using the document.title, document.lang, and document.characterSet properties.
  • Document URL is the address of the document. This information can be found in the document.URL property.
  • Document modification (last modified date) is the date and time that the document was last modified. This information can be found in the document.lastModified property.

Here are some additional details:

The DOM metadata properties can be used to get information about the document, such as its title, language, and character set. This information can be used to display the document in a way that is appropriate for the user's locale.

The document.URL property can be used to get the address of the document. This information can be used to open the document in a web browser or to save it to a file.

The document.lastModified property can be used to get the date and time that the document was last modified. This information can be used to determine if the document has been updated since the last time it was viewed.


  1. Browser Information:

  • Window dimensions and position are the size and location of the browser window. This information can be found using the window.innerWidth, window.innerHeight, and window.pageYOffset properties.
  • User agent information is a string that identifies the browser and operating system that is being used. This information can be found using the navigator.userAgent property.
  • Screen resolution is the number of pixels that are displayed on the screen. This information can be found using the screen.width and screen.height properties.


  1. Animations and Transitions:

  • CSS animations are a way to create smooth, gradual changes to the properties of an element over time. They are defined using the @keyframes rule and can be applied to any element using the animation property.
  • CSS transitions are a way to create smooth, gradual changes to the properties of an element when the value of the property changes. They are defined using the transition property and can be applied to any element.
  • Animation state and progress refer to the current state and progress of an animation. The state of an animation can be running, paused, or finished. The progress of an animation is a value between 0 and 1 that indicates the percentage of the animation that has completed.

Here are some additional details:

CSS animations are a powerful way to add visual interest and interactivity to web pages. They can be used to create a variety of effects, such as button hovers, text animations, and image slideshows.

CSS transitions are a simpler way to create smooth changes to the properties of an element. They are often used to create a more natural feel when elements are moved or resized.

The animation state and progress can be used to control the behavior of an animation. For example, you can pause an animation or change its speed by changing its state. You can also get the current progress of an animation to determine how far along it is.


  1. Browser Interaction:

  • Changing URL or location refers to the process of changing the address of the web page that is currently being displayed in the browser. This can be done using the window.location property.
  • Managing history (back, forward) refers to the ability to go back to previously visited web pages or to go forward to pages that have been visited more recently. This can be done using the window.history object.
  • Opening new browser windows or tabs refers to the ability to open new windows or tabs in the browser. This can be done using the windows.open() method.

Here are some additional details:

The window.location property can be used to get the current URL or to set a new URL. The window.history object can be used to get a list of the pages that have been visited recently. The windows.open() method can be used to open a new window or tab in the browser.

The window.location property can be used to change the URL of the current web page. For example, the following code will change the URL to https://www.google.com:

window.location = "https://www.google.com";Browser Events:        

The window.link() method can be used to open a new window or tab in the browser. The following code will open a new window with the URL https://www.google.com:

window.open("https://www.google.com");        


  1. Browser Events:

  • Window events (resize, scroll) are events that occur when the window is resized, scrolled, or closed. These events can be used to respond to changes in the size or position of the window, or to close the window when the user clicks the close button.
  • Keyboard events are events that occur when the user presses a key on the keyboard. These events can be used to respond to key presses, such as when the user presses the enter key to submit a form.
  • Mouse events (click, hover, drag) are events that occur when the user moves the mouse over an element, clicks an element, or drags an element. These events can be used to respond to mouse movements, clicks, and drags, such as when the user clicks a button to start a slideshow.

Here are some additional details:

  • Window events are triggered by the window object. The most common window events are resize, scroll, and close.
  • Keyboard events are triggered by the document object. The most common keyboard events are keydown, keyup, and keypress.
  • Mouse events are triggered by the document object. The most common mouse events are mousemove, mousedown, mouseup, click, dblclick, and drag.
  • Browser events can be used to add interactivity to web pages. For example, you can use window events to respond to changes in the size or position of the window, or to close the window when the user clicks the close button. You can use keyboard events to respond to key presses, such as when the user presses the enter key to submit a form. You can use mouse events to respond to mouse movements, clicks, and drags, such as when the user clicks a button to start a slideshow.

  1. Asynchronous Operations:

  • Fetching data via XMLHttpRequest or Fetch API refers to the process of retrieving data from a server asynchronously. This can be done using the XMLHttpRequest object or the Fetch API.
  • Manipulating data asynchronously refers to the process of updating data without blocking the main thread. This can be done using promises, async/await, or generators.

Here are some additional details:

  • The XMLHttpRequest object is a legacy way of fetching data asynchronously. It is still supported by all browsers, but it is not as efficient as the Fetch API.
  • The Fetch API is a newer way of fetching data asynchronously. It is more efficient than the XMLHttpRequest object and it is supported by all modern browsers.
  • Promises are a way of representing the eventual completion of an asynchronous operation. They can be used to chain together asynchronous operations and to handle errors.
  • Async/await is a newer syntax for working with promises. It makes it easier to write asynchronous code that is both readable and maintainable.
  • Generators are a way of creating iterators that can be used to iterate over data asynchronously. They are a more powerful way of manipulating data asynchronously than promises or async/await.


  1. Cookies and Storage:

  • Accessing cookies are small pieces of data that are stored on the user's computer by the website they are visiting. Cookies can be used to store information about the user, such as their preferences or login status.
  • Local storage is a type of browser storage that is used to store data on the user's computer. Local storage is more persistent than cookies and can be used to store larger amounts of data.
  • Session storage is a type of browser storage that is used to store data for the current session. Session storage is deleted when the browser is closed.

Here are some additional details:

  • Cookies are created by the website and stored on the user's computer. When the user visits the website again, the cookie is sent back to the website.
  • Local storage and session storage are created by the browser and stored on the user's computer.
  • Cookies can be used to store a variety of information, such as the user's preferences, login status, and shopping cart contents.
  • Local storage can be used to store larger amounts of data, such as images and videos.
  • Session storage is deleted when the browser is closed.
  • Cookies can be used to track users across websites. This can be a privacy concern, so users should be aware of how their cookies are being used.
  • Local storage and session storage are not as widely used as cookies, but they can be a more secure way to store data.

  1. Media Handling:

  • Embedding and controlling media elements (audio, video) refers to the process of inserting media content, such as audio and video, into a web page. This can be done using the <audio> and <video> tags.
  • Accessing media metadata refers to the process of getting information about media content, such as its title, duration, and author. This information can be accessed using the MediaMetadata object.

Here are some additional details :

  • The <audio> and <video> tags can be used to embed audio and video content in a web page. The <audio> tag can be used to embed audio content, such as music and podcasts. The <video> tag can be used to embed video content, such as movies and TV shows.
  • The MediaMetadata object can be used to get information about media content. The MediaMetadata object has properties for the title, duration, author, and other information about the media content.
  • Media content can be controlled using JavaScript. For example, you can pause, play, or rewind media content using JavaScript.

要查看或添加评论,请登录

Roman Denysenko的更多文章

  • Payment Card Industry Data Security Standard -v4.0

    Payment Card Industry Data Security Standard -v4.0

    The following is the content of Payment Card Industry Data Security Standard Requirements and Testing Procedures…

  • Test design techniques (Diagram)

    Test design techniques (Diagram)

    Diagram retrieved from the original book: FOUNDATIONS OF SOFTWARE TESTING. ISTQB CERTIFICATION.

  • Export extensions from Chrome

    Export extensions from Chrome

    Chrome allows to export of installed extensions simply. To export extensions as a user open Google Chrome, and enter…

    5 条评论
  • List of channels about historical processes on YouTube (will be updated)

    List of channels about historical processes on YouTube (will be updated)

    CrashCourse Web URL: CrashCourse on YouTube YouTube alias: @crashcourse Subscribers: ~15.1 M (Nov 2023) Focus: General…

    1 条评论
  • Worldwide virtual ward companies

    Worldwide virtual ward companies

    List of worldwide virtual ward companies CareBridge www.carebridgehealth.

  • CMD команды

    CMD команды

    https://adminsam.ru/scripts ====================================================================== systeminfo сведения о…

  • Fake visualization or how to deceive yourself

    Fake visualization or how to deceive yourself

    This is a small article about tips and tricks with data visualization. I'm not trying to post something new :) and of…

  • Few words about Lighthouse and Web Performance services

    Few words about Lighthouse and Web Performance services

    I don’t think that my post is unique but for some people it can be very helpful. Performance for web app is possible to…

  • How to identify and authorize the world

    How to identify and authorize the world

    Here is a real-life when you need to push yourself in a completely different world. When you don't understand the…

社区洞察

其他会员也浏览了