1

I've been looking up how to make a wysiwyg rich text area, via the execcommand options.
I found tutorials useful, but there is a problem:
No matter what I code, In order to format some text, someone has to highlight/select the text they wish to change.

How can I make it so they can have the option to either highlight text, or just type, press 'bold' for example, and keep typing as bold?
I dont want people to have to select text to change it. I want them to just have to press a button to switch the format instantly.

How would I achieve this?

SherylHohman
  • 16,580
  • 17
  • 88
  • 94
  • Any reason you've decided to re-invent this particular wheel or is this purely academic? – Phil Sep 03 '13 at 04:46
  • 1
    Is there any particular reason you are not going with existing tools like tinyMCE – Selvakumar Ponnusamy Sep 03 '13 at 04:48
  • 2
    I'm building a 100% mobile-friendly rich-text editor. I've already tried CKEditor, YUI Editor, CuteEdior, and MCE but they all are only very freindly on desktop platforms. If I make my own, I will have hands-on control over every single script, stylesheet, etc, making it much easier to negotiate between mobile vs. desktop platforms – Ryan Jeffrey Cappucci Sep 03 '13 at 05:08
  • 2
    Did you try http://stackoverflow.com/questions/299577/javascript-rich-text-editors?rq=1 – Tore Sep 04 '13 at 20:53
  • What are you asking for? An entire custom code block written by SO volunteers? Please include the code you tried, and indicate a particular piece you're having trouble with. If you are looking for an existing tool, that is against SO guidelines, but imaybe a good question for some other website/platform. As is, your Q does not meet the type of Q that SO is designed to handle. It is either too broad, opinionated, or out of scope for *this* platform. Perhaps you can revise? Please read the top 5 topics in [Asking](https://stackoverflow.com/help/asking), then `edit` accordingly to avoid deletion. – SherylHohman May 08 '20 at 21:05

0 Answers0