Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> JavaScript

สร้างเนื้อหาที่แก้ไขได้ (Editable Content) ในเอกสาร HTML

ใช้แอตทริบิวต์ contenteditable="true" ทำให้องค์ประกอบแก้ไขได้โดยตรง

ตัวอย่าง

<!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>