티스토리 뷰
$('body').on('focus', '[contenteditable]', function() {
var $this = $(this);
$this.data('before', $this.html());
return $this;
}).on('blur', '[contenteditable]', function() {
var $this = $(this);
if ($this.data('before') !== $this.html()) {
$this.data('before', $this.html());
$this.trigger('change');
}
return $this;
});
$("div.div_memo").on("change", function() {
alert($(this).html());
});
'노트 > JS' 카테고리의 다른 글
beep (0) | 2016.08.18 |
---|---|
number_format (0) | 2016.08.18 |
refresh (0) | 2016.08.18 |
Convert a DOM element to a jQuery element (0) | 2016.08.18 |
쿠키 (0) | 2016.08.17 |
댓글