Jump to content

Writing a text editor : Unbold the bold text


netpumber

Recommended Posts

Hello im trying to make a text editor for a site and i have some problems with javascript.

 

I started here as simple as can be, without any textarea and so.

At first im just trying to modify a <p>.

Here you can see the code.

 

http://jsfiddle.net/9e753/

 

As you can try i can make the text bold but i cannot undo it.

 

Also i want to ask you haw can i achieve to make this change:

(lets say we have a bolded text)

 

text

 

and we want to unbold only two or one letter eg:

 

text

text

 

and so on...

 

Any hint is welcomed.

Thanks in advance.

You'd have to insert spans around the letters you want to change.

 

You should consider using an existing tool like TinyMCE. No need to reinvent the wheel when it's a really complicated wheel and every road has different rules.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.