jeditable showing placeholder text in edit textbox

白昼怎懂夜的黑 提交于 2019-12-11 03:48:29

问题


I have an issue with jeditable and trying to customize the style of the placeholder text.

        $(".labeledit").editable("....", {
            event: "click",
            onblur: "submit",
            width:($(".labeledit").width() + 40) + "px",
            placeholder: "<span class='placeholder'>add label</span>",
            tooltip: "Click to update"
        });

In the placeholder text I add a span and associate a class. This works fine in the view but when I click on the add label text it places the placeholder text into the textbox so I get

<span class='placeholder'>add label</span>

appearing in the textbox.

If I just have placeholder: "add label" then the add label text doesn't show in the textbox.

What am I doing wrong?


回答1:


Here it is! Instead of:

...
placeholder: "<span class='placeholder'>add label</span>",
...

try switching the quote marks:

...
placeholder: '<span class="placeholder">add label</span>',
...


来源:https://stackoverflow.com/questions/12767828/jeditable-showing-placeholder-text-in-edit-textbox

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!