显示字段,允许按钮编辑和保存 html

发布于 2025-01-07 21:43:20 字数 255 浏览 2 评论 0原文

我正在尝试创建一个显示标题和段落以及“编辑”按钮的页面。

目标是段落和标题看起来像普通文本,但是当单击编辑按钮时,它们变成用户可以编辑的可写字段。编辑完成后,用户可以单击“保存”按钮,然后 html 就会更新。

这有可能吗?

此外,是否可以有一个“创建”按钮,添加一个新的标题和段落元素,这些元素是空白的,用户可以填写?

我想坚持使用 html/javascript/jquery,因为它不会在服务器上运行。

谢谢!

I'm trying to create a page where a title and paragraph are displayed, along with an 'edit' button.

The goal is that the paragraph and title seems like normal text, but when the edit button is clicked, they become writeable fields that the user can edit. When the edits have been done, the user can click a save button and the html is updated.

Is this at all possible?

Furthermore, is it possible to have a 'create' button, that adds a new title and paragraph element that are blank, which the user can fill in?

I'd like to stick to html/javascript/jquery, since this won't be running on a server.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

断桥再见 2025-01-14 21:43:20

插件已经存在,可以提供就地编辑功能:

Plugin exists already to provide in-place editing functionnality:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文