<!DOCTYPE html>
<style>
text::selection {
  fill: url(#green);
}
</style>
<svg>
  <linearGradient id="green">
    <stop stop-color="green"/>
  </linearGradient>
  <linearGradient id="white">
    <stop stop-color="white"/>
  </linearGradient>
  <text x="10" y="20" font-size="20" font-family="monospace" fill="url(#white)">PASS FAIL</text>
</svg>
<script>
var textNode = document.querySelector('text').firstChild;
var range = new Range();
range.setStart(textNode, 0);
range.setEnd(textNode, 4);
document.getSelection().addRange(range);
</script>
