HTML editor shows "undefined" instead of the entered text