Thiscontentisedita"/> Thiscontentisedita">

首頁  >  文章  >  web前端  >  在HTML文件中建立可編輯內容

在HTML文件中建立可編輯內容

WBOY
WBOY轉載
2023-09-01 08:45:241419瀏覽

在HTML文件中建立可編輯內容

使用 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&#39;t edit.</p>
   </body>
</html>

以上是在HTML文件中建立可編輯內容的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:tutorialspoint.com。如有侵權,請聯絡admin@php.cn刪除