I created a small function similar to a edit-in-place plugin.
What it does:
- gets the html content of a element on click:
var editable = $(this).html(); creates the text input field (or gets it if it exists):
var input = ($('input', this).length > 0) ? $('input', this) : $('<input type="text" value="' + editable + '" />'),replaces the element text with the input:
$(this).empty().append(input);
This works but only if the editable text doesn't contain non-encoded HTML characters.
If it has HTML characters like < >, they get converted in the 2nd step to HTML code, and mess up the input element...
I tried to escape them by using:
editable = $('<div/>').text($(this).html()).html()
but then I get a text input with escaped HTML lol :)
What can I do?
"seems to be the issue, because all text after that doesn;t show..