Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is possible to make a <div> writable by user?

have to build a system that when a user write in a box a word that starts with # this is wrapped inside an html element. Inside input-text and textarea html don't work. I had thought with a div, is possible?

like image 265
byterussian Avatar asked Jan 27 '10 20:01

byterussian


1 Answers

Try the following:

<div contenteditable="true">Hello, edit me!</div>

Not tested in Opera, works in Firefox 3, Google Chrome, Safari and Internet Explorer 6, 7 and 8.

like image 172
Andy E Avatar answered Sep 27 '22 16:09

Andy E