mikezang
asked on
How can I select multiple tetx on web page?
I knew how to use
txt=document.body.createTe xtRange();
txt.findText(str)
txt.select();
to select str on web page, but i only one str can be selected using this method, I want to select all the str on page, what can I do? is it possible?
txt=document.body.createTe
txt.findText(str)
txt.select();
to select str on web page, but i only one str can be selected using this method, I want to select all the str on page, what can I do? is it possible?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No the string methods on work on the text, the background is not exposed in the string object.
Cd&
Cd&
ASKER
Thanks.
But I have a new question, the 'red'.fontcolor('red') is changed to '<FONT COLOR="red">red</FONT>', but I use that string in another string, something looks like as bwlow, it doesn't work!
str = "<A HREF=javascript:void onClick='document.write(\" green black <FONT COLOR="red">red</FONT>\"); return false;'>COLOR</A>"
I need this one as below, what can I do?
str = "<A HREF=javascript:void onClick='document.write(\" green black <FONT COLOR=\\\"red\\\">red</FON T>\");retu rn false;'>COLOR</A>"
But I have a new question, the 'red'.fontcolor('red') is changed to '<FONT COLOR="red">red</FONT>', but I use that string in another string, something looks like as bwlow, it doesn't work!
str = "<A HREF=javascript:void onClick='document.write(\"
I need this one as below, what can I do?
str = "<A HREF=javascript:void onClick='document.write(\"
I'd have to see more of the code to understand what you are doing, but if that sample is the way you are generating code, then this method is not going to work for you. You need to re-think the design you are creating a maze of unmaintainable code.
Cd&
Cd&
ASKER
It is ok even the selection isn't used. but I want to the highlight looks like the selection, I mean the text is displayed in turn over mode, is it posiible?