The Range.selectNodeContents() method sets the Range to contain the contents of a Node.
Range.selectNodeContents()
MDN Reference