Author: Saim Khalid
-
DOM Navigation
In JavaScript, with HTML DOM we can navigate the tree nodes using the relationship between the nodes. Each HTML element is represented as a node in the DOM tree. The HTML document object is represented as root node. There are different types of nodes such as root node, parent, child and sibling nodes. The relationship between these nodes help to navigate the DOM tree. What are DOM…
-
DOM Animation
The DOM animation can be achieved by changing the DOM element’s style using JavaScript. When changes are gradual and time interval is small, the animation looks continuous. Generally, there are three ways to animate a DOM element: This chapter provides a basic understanding of how to animate DOM elements using JavaScript. Animate DOM Elements with JavaScript JavaScript…
-
Changing CSS
Changing CSS with JavaScript JavaScript allows you to change the CSS of the HTML element dynamically. When HTML gets loaded in the browser, it creates a DOM tree. The DOM tree contains each HTML element in the object format. Furthermore, each HTML element object contains the ‘style‘ object as a property. Here, a ‘style‘ object contains various properties like color,…
-
Changing HTML
Changing HTML with JavaScript The HTML DOM allows us to change the HTML elements with JavaScript. You can customize or dynamically update the HTML elements using the various methods and properties. For example, you can change the content of the HTML element, remove or add new HTML elements to the web page, change a particular…
-
DOM Forms
The DOM Forms The HTML DOM document forms are used to get the data from the users. In JavaScript, you can use the ‘forms’ collection of the ‘document’ object to access all <form> elements of the HTML document. You can access all forms elements of particular forms and manipulate them. Using JavaScript, you can validate the form values, handle…
-
DOM Attribute
The attribute interface in the Document Object Model (DOM) represents attributes of an element as an object. And, this object represents an HTML attribute, through which we can control the functionality of HTML elements. The attributes of an element are stored in an array-like unordered collection called NamedNodeMap. You can access nodes of this array…
-
DOM Elements
The DOM Elements The HTML DOM elements is the acronym for the Document Object Model elements. With JavaScript, we can manipulate the HTM elements. We can access the HTML elements using id, attribute, tag name, class name, etc. When a web page loads in the browser, it creates a DOM tree representing the web page’s structure. The web page…
-
DOM Document
JavaScript DOM Document The JavaScript DOM document object owns all objects in the webpage. It represents the webpage. When the webpage is loaded in the web browser, it creates an HTML DOM ‘document’ object. It is the root of the HTML document. The DOM document object contains the various properties and methods you can use…
-
DOM Methods & Properties
In JavaScript, DOM methods are used to perform a particular action on HTML elements. The DOM represents a HTML document or web page with a logical tree. In the tree, each branch ends in a node, and each node contains objects. DOM methods allow us programmatic access to the tree. Using the DOM methods, you can change the document’s structure, style, or content.…
-
Document Object Model
The HTML DOM allows JavaScript to access and modify the content of HTML elements. JavaScript can change all HTML elements, attributes, CSS styles in the page. JavaScript can also add, remove the HTML elements and attributes. Using JavaScript, we can even create new events in the page. Every web page resides inside a browser window which can…