View Full Version : .createTextRange() ???

07-16-2003, 06:50 AM
What does .createTextRange do? I saw this in a hacked message board to replace certain areas with whatever images etc they wanted. I did a search and of course microsoft was on the top. Of course their examples never work and IE always has an error to complain about. How do I use this? And what other things relate to it?

07-16-2003, 03:31 PM
Not much detail, but I use it to allow people to copy the contents of a <textarea> to their clipboard with the click of a button.

function copyTo(obj) {
var oControlRange = obj.createTextRange()

<input type="button" onclick="copyTo(this.form.mytextarea)" class="submit" value="Copy Addresses (IE only)">

07-16-2003, 04:41 PM

07-17-2003, 02:23 AM
I tried that example (the microsoft link) and it didn't work. Whatever it is, it is not IE 6 compatible and not even for Windows. Stupid M$.

07-18-2003, 06:06 AM
Can someone tell me what the TextRange stuff is in the source of this page is? The apparently used it to change existing code found in the body to other stuff in order to support their hacked theme. It works fine when I view it, but no examples of TextRange are working. Why?