about summary refs log tree commit diff
path: root/usth/ICT3.2/prac/3/3-vanilla.html
blob: 0cee9201e54d61a0b63bebddc5c2b366c737304e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<!DOCTYPE html>
<html>
<body>
  <form>
    <input id='field1' type='text' value='Field 1'>
    <input id='field2' type='text' value='Field 2'>
  </form>
  <script>
    document.getElementById('field1').addEventListener(
      'blur', event => document.getElementsByTagName('body')[0]
                               .setAttribute('style', 'background-color: #436e58'))
  </script>
</body>
</html>