mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-11 01:22:43 +02:00
26 lines
466 B
HTML
26 lines
466 B
HTML
<!DOCTYPE html>
|
|
<link rel="match" href="../expected/selection-in-inline-element-ref.html">
|
|
<style>
|
|
p {
|
|
font-size: 20px;
|
|
line-height: 1.5;
|
|
margin: 10px 0;
|
|
}
|
|
|
|
p::selection {
|
|
background-color: red;
|
|
}
|
|
|
|
span::selection {
|
|
background-color: red;
|
|
}
|
|
</style>
|
|
|
|
<p><span id="target">Hello World</span></p>
|
|
|
|
<script>
|
|
const range = document.createRange();
|
|
range.selectNodeContents(document.getElementById("target"));
|
|
getSelection().addRange(range);
|
|
</script>
|