简体   繁体   中英

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).

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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