summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/selectors/selector-read-write-type-change-001.html
blob: 0dd083002a67c64718dd33d896d6730c2bd4dac8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html>
<html>
  <head>
    <title>Check for correctly updating :read-write matching on type change</title>
    <link rel="match" href="selector-read-write-type-change-001-ref.html">
    <link rel="help" href="https://drafts.csswg.org/selectors-4/#rw-pseudos">
    <style>
      span { color: green; }
      :read-write + span { color: red }
    </style>
    <script>
      onload = function() {
        document.querySelector("input").type = "button";
      }
    </script>
  </head>
  <body>
    <input required><span>This should be green</span>
  </body>
</html>