Skip to content

Commit

Permalink
Change eventhandler
Browse files Browse the repository at this point in the history
  • Loading branch information
jihyerish committed Jun 25, 2024
1 parent 21f0b67 commit 636317a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions demos/target-text/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ <h4 id="one">…</h4>
<p id="discription"></p>
<script>
const pseudoTargetTextElmStyle = getComputedStyle(document.body, "::target-text");
//let pseudoTargetElmStyle = getComputedStyle(document.body.querySelector(":target"), "::target-text");
let discription = document.getElementById("discription");

window.location.hash = "#:~:text=testing";
document.addEventListener("DOMContentLoaded", function(event) {

window.onload = (event) => {
discription.innerText = `Color of the target-text element: ${pseudoTargetTextElmStyle.color}`;
});
};
</script>
</body>
</html>

0 comments on commit 636317a

Please sign in to comment.