tags:

views:

227

answers:

1

Hi i am using an dynamic div which is editable for input text. its working fine on IE but not on firefox. I need to show html content in div. can we make div editable for firefox also?

+1  A: 

Firefox requires the designMode to be set on an iFrame. The specification doesn't explicitly mention this but the following quote sort of implies it already

For example, in JavaScript, if you have an iframe with an id of 'edit', you can get its contentDocument and set designMode to "on" like this:

You will find alot of browser differences in how they handle designMode so be prepared and take it as a challenge or else you might lose a few hairs in the process.

Martijn Laarman
can i use div with iframe can u explain with example?
pradeep
Question has yet to unvague about there being an iframe being used. Or anything for that matter.
random
pradeep you need to render an iframe (or substitute the div with an iframe at runtime) to enable designMode. Designmode doesn't work on any other html element in FireFox.
Martijn Laarman
Of course you can render `<div><iframe>...` if you must have a div container around it.
Martijn Laarman
thanks martijn, i will try to implement iframe.
pradeep