Skip to content

Truly independent web browser

436 B
Raw Blame
<!DOCTYPE html>
<link rel="match" href="../expected/selection-with-custom-image-background-ref.html" />
<style>
img {
    width: 50px;
    height: 50px;
    vertical-align: top;
}
img::selection {
    background-color: red;
}
</style>
<img id="selected-image" src="../data/smiley.png">
<script>
const range = document.createRange();
range.selectNode(document.getElementById("selected-image"));
getSelection().addRange(range);
</script>