en.javascript.info/2-ui/4-forms-controls/2-focus-blur/3-editable-div/source.view/index.html
Ilya Kantor af0ee2a49e up
2017-03-18 14:46:13 +03:00

27 lines
457 B
HTML

<!DOCTYPE HTML>
<html>
<head>
<link type="text/css" rel="stylesheet" href="my.css">
<meta charset="utf-8">
</head>
<body>
<ul>
<li>Click the div to edit.</li>
<li>Enter or blur saves the result.</li>
</ul>
HTML is allowed.
<div id="view" class="view">Text</div>
<script>
// ...your code...
// Note: <textarea> should have class="edit"
// my.css has styles to make it the same size as div
</script>
</body>
</html>