I want to know how to make a input text field like the one in facebook or twitter where text smiles are converted into graphics and the ability to add extra markup.
I have gone through other stackoverflow questions like
How do I make an editable DIV look like a text field?
So I know how to make an editable div using contenteditable
, thats not what I wanted to know.
I have inspected facebook comment box via chrome and it shows they use an Invisible input
box and a div
to show the output
I have removed facebook classes and added some my own styles to see the input box
So what i want to know is
- How the
input
can be hidden and the things that user enters shows up in thediv
- How to make the hidden
input
field to be selected when the user focus ondiv
- I want to know how to implement this technique with an
input[type=text]
anddiv
In General It would be much helpful if adding a hash tag method is explained. Thanks!