Hi, i have a problem to modify html text.
i need to insert a [header][/header] tag in a textarea. if user has select some text, then the [header] tag must place at start of the 1st html tag before the text selected and the [/header] must place in the last HTML tag.
e.g :
if user select "this is a trial text" which HTML source is <p><font color="#FF0000">this is a trial text</font></p> and then user click the header button, then i need to place [header] tag before the <p> start tag and [/header] after <p> closing tag.
I set the range text with pasteHTML but the HTML tag is always outside [header][/header] tag. Is there another method that I can use to change/modify selected text in textarea???
best regards,
Tiono
i need to insert a [header][/header] tag in a textarea. if user has select some text, then the [header] tag must place at start of the 1st html tag before the text selected and the [/header] must place in the last HTML tag.
e.g :
if user select "this is a trial text" which HTML source is <p><font color="#FF0000">this is a trial text</font></p> and then user click the header button, then i need to place [header] tag before the <p> start tag and [/header] after <p> closing tag.
I set the range text with pasteHTML but the HTML tag is always outside [header][/header] tag. Is there another method that I can use to change/modify selected text in textarea???
best regards,
Tiono