简体   繁体   English

如何使用jQuery将标签更改为文本框

[英]How to make a label change to a text box using jQuery

I have some labels that I want to allow users to edit. 我有一些标签,我想让用户编辑。 Is it possible to do this and if so how (using jQuery). 是否可以这样做,如果是这样(使用jQuery)。

When a user clicks a label, it turns into a textbox, which has the existing "label text" contained within. 当用户单击标签时,它将变为文本框,其中包含现有的“标签文本”。 When the user then edits the label and clicks somewhere other than the text box, the value is saved. 然后,当用户编辑标签并单击文本框以外的某处时,将保存该值。

This might actually be a few pieces of functionality in one, if you could help, it would be much appreciated. 这可能实际上是一个功能在一个,如果你可以帮助,它将非常感激。

What you are describing is often referred to as an "in place editor". 您所描述的通常被称为“就地编辑”。 You should check out the Jeditable plugin demo page . 您应该查看Jeditable插件演示页面 I think it's exactly what you're looking for. 我认为这正是你要找的。

I would suggest looking into some of the "edit in place" plugins. 我建议调查一些“就地编辑”插件。

Check out the live demo . 查看现场演示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM