|
Tested this just as you described in Chrome/FF...still same thing. What works for you exactly?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/2001/REC-xhtml11-20010531/DTD/xhtml11-flat.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script>
var original;
$(document).ready(function() {
$(".info").click(function() {
original = $(this).html();
var textarea = '<div><textarea name="comments" cols="60" rows="3">' + $(this).html() + '</textarea>';
var button = '<input type="button" value="Save" class="saveButton" /> OR <input type="button" value="Cancel" class="cancelButton" /></div>';
$(this).after(textarea+button).remove();
});
$('.cancelButton').live('click',function() {
$(this).parent().parent().html('<div class="info">' + original + '</div>');
$(this).parent().remove();
});
});
</script>
<style type="text/css">
</style>
</head>
<body>
<div class="info">This is a test</div>
</body>
</html>
|