iframe selected text set into bold using javascript

please send the simple code for text editor using javasrcipt

Who is Participating?
MaxOvrdrv2Connect With a Mentor Commented:
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...
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:
winsoftechAuthor Commented:
Please sent

simple code of

how to get iframe selected text and  how to put  it

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";
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.