I have the following JQuery in my page. The page loads fine, and the code works initially. If I edit the textarea field, clicking the field again doesn't work. Is there a way to bind the JQuery functionality even after the textarea is edited?
$(document).ready(function() {
$("#prop_notes").dblclick(function() {
var timestamp = '2013-04-01 20:40:00';
var userid = '1';
var username = 'Jim Williams';
if ($('#prop_notes').val() == '') {
$("#prop_notes").text("Timestamp: " + timestamp + "\nUser ID: " + userid + "\nUser: " + username);
}
else {
$("#prop_notes").text($("#prop_notes").text() + "\n\n- - - - - - - - - - - - - - - - - - - -\n\nTimestamp: " + timestamp + "\nUser ID: " + userid + "\nUser: " + username);
}
});
});
Reproducible behavior fiddle: http://jsfiddle.net/njgray/MxPNX/1/