Issue
Let's say I have a web page which contains command line commands for the user to copy paste. Any way to display it with HTML/CSS which makes double clicking on one word select the entire command?
Example: ls -l /myfiles - clicking on "myfiles" here selects only that word, but for the user it'd be a better experience if the entire command was selected for easier copy-pasting. Again: No javascript is the question here.
Solution
No there isn't any way to do that for a double click without javascript.
The default browser behavior is the only behavior available without javascript.
- Tripple-click will works to select a single line.
- If you want to select a different pattern, you need javascript.
- If you only want this behavior on double-click, you need javascript.
Answered By - Rémi Becheras
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.