Example
- We use the id attribute for an element:
<div id="part2"> … </div>
- We can link to it from anywhere:
<a href="my-page.html#part2"> … </a>
- We can create styles for it with CSS:
#part2 { background-color: #ffc; color: #000; font-size: 100%; }
(We will learn about CSS in other tutorials.)
- We can get it to manipulate it with JavaScript within the Document Object Model (DOM):
document.getElementById('part2');
(You can learn about DOM in its own tutorial.)
