WEB DEVELOPER SITE
HTMLCSS JAVASCRIPTSQL PHPBOOTSTRAP JQUERYANGULARXML
 

JavaScript The HTML DOM Document Object


The HTML DOM Document Object

If you need to get to any component in a HTML page, you generally begin with getting to the record object.


Finding HTML Elements

Method Description
document.getElementById(id) Find a component by component id
document.getElementsByTagName(name) Find components by label name
document.getElementsByClassName(name) Find components by class name

Adding and Deleting Elements

Method Description
document.createElement(element) Create a HTML element
document.removeChild(element) Remove a HTML component
Remove a HTML element Replace a HTML component
document.write(text) Write into the HTML yield stream