hi
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?
hi
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?
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.
Yes, this is possible.
:)
Seriously, you'll need to parse user input and when your parser engine see a "#" symbol, it just wait for the next [space] (for example as a element id delimiter), create a new DOM Element with this id and after that it must update innerHTML of this element by everytime user entered a symbol.
Not sure exactly what you are looking for, but you can make divs editable like this:
<div contentEditable="true"></div>
Not sure why a input or textarea won't work; you might consider handling the events fired when a user enters data into a textarea or a input to accomplish your goal. Or you might look into a wysiwyg editor.