doudilin1225 2013-06-20 13: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 13: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.

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

报告相同问题?

悬赏问题

  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错