Jump to content

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.

Edited by netpumber

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.