doudilin1225 2013-06-20 05:15
浏览 255
已采纳

如何将contenteditable元素的值赋予jquery

$("#txt1").change(function()
{
     alert(this.value);
});
<span id="txt1" contenteditable="true"> </span>

I have to work with php and i edit dynamically data into my table like datatable, when change my content nothing event occurred.

  • 写回答

1条回答 默认 最新

  • drwf69817 2013-06-20 05:19
    关注

    .change() event is not available for span elements. From jQuery's .change() documentation:

    This event is limited to input elements, textarea boxes and select elements. For select boxes, checkboxes, and radio buttons, the event is fired immediately when the user makes a selection with the mouse, but for the other element types the event is deferred until the element loses focus.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部