Hello.

There is a scratch that allows when you click on an item of information, such as a phone, replace it with input and edit.

The script itself: http://jsfiddle.net/8qsFM/

It works with input and textarea, but I need another important function to select the list, for the same opportunity to edit.

As I understand the script works as follows, if a click occurs on a div with the class .editable, then input is output, if .editable-area, then textarea is output.

How to make it so that if you click on a div with the class .editable-select, then the select list is displayed.

I can not figure out how to add functionality. Help...

    1 answer 1

    I need this

    var editElement = $editable.hasClass('editable') ? '<input type="text" />' : '<textarea></textarea>'; 

    remake the if-s in the chain, and add another branch, inside which it will form html for the future select element and then it will be bolted instead of the current text field.

    • I didn’t understand how to do this a bit = (I tried to add a third element, but nothing works then ... = ( - Alexander Sizintsev
    • one
      Is there an updated jsfiddle? let's continue there. - Alexey Anufriev
    • I do not understand you ... - Alexander Sizintsev
    • one
      "I tried to add ...", issue your attempts at jsfiddle.net and continue to sort things out. - Alexey Anufriev
    • Here is how I tried jsfiddle.net/8qsFM/2 - Alexander Sizintsev