DOM
<html>
<head>
<title>Hello, world</title>
</head>
<body>
<h2>Here's my page</h2>
<p>World, hello</p>
<a href="test.html">Link</a>
</body>
</html>
<html>
<head>
<title>Hello, world</title>
</head>
<body>
<h2>Here's my page</h2>
<p>World, hello</p>
<a href="test.html">Link</a>
</body>
</html>
<html>
<head>
<title>Hello, world</title>
</head>
<body>
<h2>Here's my page</h2>
<p>World, hello</p>
<a href="test.html">Link</a>
</body>
</html>
<html>
<head>
<title>Hello, world</title>
</head>
<body>
<h2>Here's my page</h2>
<p>World, hello</p>
<a href="test.html">Link</a>
</body>
</html>
<html>
<head>
<title>Hello, world</title>
</head>
<body>
<h2>Here's my page</h2>
<p>World, hello</p>
<a href="test.html">Link</a>
</body>
</html>
<html>
<head>
<title>Hello, world</title>
</head>
<body>
<h2>Here's my page</h2>
<p>World, hello</p>
<a href="test.html">Link</a>
</body>
</html>
PROPERTY | DESCRIPTION |
innerHTML | Holds the HTML inside a set of HTML tags. |
nodeName | The name of an HTML element or element’s attribute. |
id | The "id" attribute of an HTML element |
parentNode | A reference to the node one level up in the DOM. |
childNodes | An array of references to the nodes one level down in the DOM. |
attributes | An array of attributes of an HTML element. |
style | An object encapsulating the CSS/HTML styling of an element. |
METHOD | DESCRIPTION |
getElementById(id) | Gets the element with a given ID below this point in the DOM. |
getElementsByTagName(tag) | Gets all elements with the given tag below this point in the DOM. |
appendChild(node) | Add the given node to the DOM below this point. |
removeChild(node) | Remove the specified child node from the DOM. |
METHOD | DESCRIPTION |
getElementById(id) | Gets the element with a given ID below this point in the DOM. |
getElementsByTagName(tag) | Gets all elements with the given tag below this point in the DOM. |
appendChild(node) | Add the given node to the DOM below this point. |
removeChild(node) | Remove the specified child node from the DOM. |
document.getElementById("colorDiv").style.backgroundColor = "green";
$("colorDiv").css("background-color", "green");
$("colorDiv").css("background-color", "green");
https://api.jquery.com