Javascript DOM HTML Document designMode Property set

Introduction

Make the entire document editable:

document.designMode = "on";

The designMode property sets whether the document is editable or not.

View in separate window

<!DOCTYPE html>
<html>
<body>
<p>This document is editable!</p>

<p>Try editing any text inside this document.</p>

<script>
document.designMode = "on";
</script>/*w w w.  j  av a2 s.  c  o  m*/

</body>
</html>

The designMode property sets or gets whether the document is editable or not.

Property Values

Value Description
off Default value. The document is not editable
onThe document is editable

The designMode property returns a String, "on" or "off".




PreviousNext

Related