HTML pre tag auto-select
Is it possible to auto-select the text in a PRE tag 开发者_JAVA技巧without the use of Javascript?
No, you have to use scripting to achieve that. There might be some accessibility tools out there that does that for you on form elements (like autofocusing on the first input field in a form) but probably not for arbitrary elements and depending on your actual use-case this might not be an option for you (if it even exists).
And to my knowledge the whole range selection in JavaScript is still not standardized AND implemented by all relevant browser manufactures in that standardized way ;-) ( http://www.quirksmode.org/dom/range_intro.html )
精彩评论