I've noticed on a couple of websites such as Facebook, and Twitter that instead of using regular <input>
fields in their markup, they use a <span>
and append what the user types onto it using JavaScript.
This process is used both, when a user sends direct messages to other users, when a user posts, and when a comment is made on a post.
I can't think of any possible reason as to why this would be beneficial to use over the HTML5 native <input>
tag..
So what are the benefits of using this method? And if there aren't any, why are they doing it?
contenteditable
attribute. It's entirely done in Js.. strange