about summary refs log tree commit diff
path: root/usth/ICT3.2/prac/3/1-vanilla.html
blob: 160b4134d9313e8299a4307c3e53615c3614615c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!DOCTYPE html>
<html>
<body>
  <h1>Introduction</h1>
  <div>
    <h1>About HTML</h1>
    <h1>About CSS</h1>
  </div>
  <h1>About JavaScript</h1>

  <script>
    for (let parent of document.getElementsByTagName('div'))
        for (let child of parent.children)
            if (child.tagName == 'H1')
                child.setAttribute('style', 'background-color: #436e58')
  </script>
</body>
</html>