Firefox select text range
问题 A quick question: how do I programatically select the text fragment of the page in FireFox? For example, there's a paragraph of text, user clicks the button and symbols from 10-th to 15-th are selected as if user dragged a mouse in a regular way. 回答1: In Firefox, you can use the Range object, as specified by W3C. <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Range test</title> <style> #trigger { background: lightgreen } </style> </head> <body> <p id="test">This is some (rather