/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Using a DIV as a Textarea

I’m assuming the JavaScript section is the right spot to put this question, but maybe I’m wrong.

Does anyone know where I can find a tutorial on how to make a DIV into a textarea. I’ve noticed that Facebook does this and so does a lot of Google’s stuff. Just looking to see how they pull that off.

Thanks a lot!

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@empireapathyauthorOct 01.2010 — Nevermind. Right after I posted this, I took a second look at it and figured it out. I never noticed the contenteditable attribute.

So for those looking for how to do this, you would type something like this:
[CODE]<div contenteditable="true"></div>[/CODE]

Simple as that.
Copy linkTweet thisAlerts:
@FangOct 01.2010 — It looks like a textarea, but in most cases it's an iframe.

Check out Rich Text Editors or simpler a Shoutbox
×

Success!

Help @empireapathy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...