james james - 11 months ago 38
HTML Question

How to create an input field where you can type naturally, and then it translates it into HTML?

Not entirely sure how to ask this question so sorry about that... any pointers on where to look is good.

I'm trying to have a

input field just like when you post a new StackOverflow question. You can have line spaces, you can bold text, you can insert link etc.

However, when you push some kind of button, all of that gets translated into a long HTML string (e.g., spaces become
, bold becomes
, link becomes
). Is there a way to do this with some kind of JS plug in?

Answer Source

What you describe is a What You See Is What You Get (WYSIWYG) editor.

Google "WYSIWYG editor library"