Div+contenteditable 模拟 textarea 及存在的问题


The contenteditable global attribute is an enumerated attribute indicating if the element should be editable by the user. If so, the browser modifies its widget to allow editing. The attribute must take one of the following values:

  • true or the empty string, which indicates that the element must be editable;
  • false, which indicates that the element must not be editable.
    If this attribute is not set, its default value is inherited from its parent element.
Read more

jQuery 监听隐藏表单


<input type="hidden" value="" id="datas" name="datas">

正常的表单可以使用 .change() 事件监听其 value 的改变,而隐藏表单其 value 改变时不会触发 change() 事件!


当为隐藏表单赋值后,使用 trigger() 手动触发 change() 事件:

Read more