morgancodes
morgancodes

Reputation: 25285

editable div content in html 4

Wondering if there's any not-too-hard way to edit non-form text in html 4. I know there's a contentEditable property that can be set in html 5, but I want better browser support than that will give me. It seems like gmail is doing something like this in their chat status indicator. This works properly on IE6 (which I don't believe supports html 5). Has anyone seen this done? thanks, -Morgan

Upvotes: 0

Views: 1309

Answers (3)

Jeremy DeGroot
Jeremy DeGroot

Reputation: 4506

Have you considered using CSS to make a <textarea> look like something else? Just because something is a form control, doesn't mean it has to look like once. You can change the background, shadows, borders etc.

Upvotes: 1

bobince
bobince

Reputation: 536765

HTML5's contentEditable is modelled after the existing property from IE, which is also supported by (at least) Firefox and Safari, so you don't have to wait for HTML5 to be ‘supported’.

It's an incredibly ugly piece of design, but it works.

Upvotes: 1

Jeremy
Jeremy

Reputation: 1208

You can set the innerText or innerHTML property in javascript for most dom elements including divs and tables.

Upvotes: 0

Related Questions