user3603684
user3603684

Reputation: 61

How to build simple rich textbox?

How do I build a very simple rich textbox using javascript or jquery to make selected text bold ?

< textarea id="editor">< /textarea>
< input type="button" onclick="bold()" value="Bold selected" />

Here, the text should be appeared to be really bold but not between < b> and < /b> tag. I mean actually like we are editing in wordpress or other rich textbox.

Upvotes: 3

Views: 11613

Answers (2)

phpcoderx
phpcoderx

Reputation: 570

The WYSIWYG editor plugins don't actually use a textarea.They use an editable div which makes it possible to show rich text .

These links should help you get started:

HTML contentEditable

WYSIWG Tutorial 1

WYSIWG Tutorial 2

Upvotes: 5

CMPS
CMPS

Reputation: 7769

You cannot make just a selected text inside a textarea to be bold unless you use some plugins (if exist) or create your own. But instead of inventing the wheel, just use free editors like codemirror or ckeditor

Upvotes: 1

Related Questions