
使用 contenteditable属性,使元素的内容可编辑。
示例
您可以尝试运行以下代码以了解如何在 HTML 中实现 contenteditable 属性。将光标保持在可编辑内容上即可对其进行编辑。
<!DOCTYPE html>
<html>
<body>
<p contenteditable = "true">This content is editable. Try to edit it.</p>
<p>This is a normal content. It won't edit.</p>
</body>
</html>

