Reputation: 5513
How can I (with Javascript) get the new content from a contentEditable
DOM element on a page. Would it be as simple as using jQuery in such as way:
$("#content").on("keyup", ".editable", function(e){
var newText = $(this).text();
console.log("New text is: "+newText);
});
Upvotes: 0
Views: 61
Reputation: 5513
The solution was simple as I was (admittedly) being lazy and asking on here. Here's my JSFiddle for those in the future to see: http://jsfiddle.net/ysLPq/. See code below:
$(document).ready(function(){
$(document).on("keyup", ".editable", function(){
console.log($(this).text());
});
});
Upvotes: 1