iframe selected text set into bold using javascript



please send the simple code for text editor using javasrcipt

LVL 1
winsoftechAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MaxOvrdrv2Commented:
to make a specific textbox text be bold:

documentgetElementById("text").style.cssText = "font-weight: bold";

to get the selected text (for example, Dan out of Dan977), you must use a rich text editor, like the one found here:
http://www.kevinroth.com/rte/demo.htm
0
winsoftechAuthor Commented:
Please sent

simple code of

how to get iframe selected text and  how to put  it


0
MaxOvrdrv2Commented:
IFRAME can contain anything... you cannot, for example, BOLD an HTML paragraph... it has to be text that is within a textarea, OR within a textbox...

if this is the case for you, and it's within an IFRAME, then it's super simple:

document.getElementById("IFrameID").document.getElementById("TextBoxID").style.cssText = "font-weight: bold";
0
winsoftechAuthor Commented:
above code is returns error  it is change the parent window text box style only
please understand my request
I need  how to get iframe body content (cross browser) and how to replace it
0
MaxOvrdrv2Commented:
the only thing you COULD do, is get the content, then put it into a variable, then change it, and then display it into another IFRAME... you cannot replace anything within an IFRAME... you can read, and that's it...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.