contenteditable change events

前端 未结 19 2312
粉色の甜心
粉色の甜心 2020-11-22 01:36

I want to run a function when a user edits the content of a div with contenteditable attribute. What\'s the equivalent of an onchange

19条回答
  •  一向
    一向 (楼主)
    2020-11-22 01:55

    This thread was very helpful while I was investigating the subject.

    I've modified some of the code available here into a jQuery plugin so it is in a re-usable form, primarily to satisfy my needs but others may appreciate a simpler interface to jumpstart using contenteditable tags.

    https://gist.github.com/3410122

    Update:

    Due to its increasing popularity the plugin has been adopted by Makesites.org

    Development will continue from here:

    https://github.com/makesites/jquery-contenteditable

提交回复
热议问题