mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:38:12 +00:00

Otherwise, we will treat the loaded style sheet as if it had media="all" which is not always appropriate.
17 lines
465 B
HTML
17 lines
465 B
HTML
<style>
|
|
body {
|
|
background: green;
|
|
}
|
|
</style>
|
|
<script src="include.js"></script>
|
|
<script>
|
|
let link = document.createElement("link");
|
|
link.setAttribute("rel", "stylesheet");
|
|
link.setAttribute("href", "body-background-color-red.css");
|
|
link.setAttribute("media", "print")
|
|
document.head.appendChild(link)
|
|
|
|
window.onload = function() {
|
|
println("document background: " + getComputedStyle(document.body).backgroundColor)
|
|
}
|
|
</script>
|