Yes, this is a function originally written by Mark Honnen that does the job. <script language=javascript> /** * Creates a selection on any passed html element * * @author Mark Honnen * @param p_oDomObject - a DOM object * @return Always false */ function selectElm (p_oDomObject) { var sel, rng, doc, win; if ((doc = p_oDomObject.ownerDocument) && (win = doc.defaultView) && 'undefined' != typeof win.getSelection && typeof doc.createRange !='undefined' && (sel = window.getSelection()) && typeof sel.removeAllRanges != 'undefined') { rng = doc.createRange(); rng.selectNode(p_oDomObject); sel.removeAllRanges(); sel.addRange(rng); } else if (document.body && typeof document.body.createTextRange != 'undefined' && (rng = document.body.createTextRange())) { rng.moveToElementText(p_oDomObject); rng.select(); } return false; } </script> <blockquote onclick="selectElm(this)"> Here is a quotation Here is a quotation Here is a quotation </blockquote> Code (markup):
hi, works a treat and selects beautifully. i'm assuming there's no way for it to autocopy upon click? thanks again
It's possible, you need a .swf file working as a transportation helper though, to make it work with Firefox. A working example is in the zip file.