Set the document to design mode
To set the entire document to design mode, you can set the designMode property on the document object itself. The script will not run when the document is in design mode. It might seem like a good idea to have a button within the document to turn design mode on or off, but it has no effect. Once the user opens it, it will remain in design mode. The next time they click this button it will be selected instead of clicked, and they click it again and will be able to edit its value. This is why if you want to use design mode it is best to set the designMode attribute on the document in the frame or IFrame. The following example shows how to turn on design mode for a document in an IFrame: