When a divs value is changed, how Can I trigger an event?
Click this div to edit it
-
In chrome and maybe in other browsers there is bug, when user presses tab it will create space and append apple-be span or some thing like that.. to remove that user
var contents = $('.changeable').html();
$('.changeable').blur(function() {
if (contents!=$(this).html()){
alert('Handler for .change() called.');
$(".Apple-tab-span").remove();
contents = $(this).html();
contentsTx = $(this).text();
alert(contentsTx);
}
});
This will remove the span..
it same as above code just modified it little, or u can add
.Apple-tab-span
{
Display:None;
}
and this will also solve problem ..
http://jsfiddle.net/a4QNB/312/
Just modified @Nikals answer ...