blob: 6e6967de65719ea37a1496d064aa5a4f789ea4ae (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
<!DOCTYPE html>
<html>
<head>
<style>
dialog {
visibility: hidden;
}
::backdrop {
position: absolute;
top: 100px;
left: 100px;
height: 100px;
width: 100px;
background-color: red;
}
.green::backdrop {
background-color: green;
}
</style>
</head>
<body>
Test dynamic changes to ::backdrop style. The test passes if there is a green box below.
<dialog></dialog>
<script>
dialog = document.querySelector('dialog');
dialog.showModal();
dialog.classList.add('green');
</script>
</body>
</html>
|