What is DOM ?
To Check Open You Browser And Navigate To Console Which Allow Us to interact With js As look On Below Picture:
DOM IS Based on by the W3C For More . There is number Of advantage why we need to use DOM:
- Core Specification
- Events Specification
- Style Specification
- Validation Specification
- Load and Save Specification
How DOM Work?
Some Specification What Can We Do using DOM With Web page?
getElementById Which is Define By js method on
document returns a HTML element based on node specified by
id attribute. We used almost every time that we want to manipulate info from, an element on our document. As Eg:
As We are Going to manipulate title element we will define
document.getElementById(‘Title’); As We See This is the way How we Can define
getElementById By web console.
Selecting Multiple Element At once
As here we are Going to define multiple element at once as we are accessing element Bytheir Class or by their tag attributes So here Accessing element By class we dfine As,
As here We need to define Class attribute name which we need to manipulate Through Console
getElementsByClassName method of document interface returns an array-like object of all child element which have all of given class name() as we define. To access Element By Their Tag As above model we define
To Define Tag We simply Use
document.getElementsByTagName('your tag'); in console to manipulate element as
getElementsByTagName() methos returns a collection of all element in the document with the specified tag name as we define.
Here Below List Of common APIs in web and xml page Scripting Using The DOM