var addClose function edit click function question div label html text

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var addClose = function() {
$('#edit').click(function() {
q = $('#question div label');
q.html('<textarea rows=10> ' + q.text() + '</textarea>');
$('#edit').text('Close');
edit = $('#edit');
edit.attr('id', "close");
addEdit();
});
};
var addEdit = function() {
$('#close').click(function() {
text = $('#question textarea').val();
label = $('#question label');
label.html(text);
close = $('#close');
close.text('Edit');
close.attr('id', "edit");
addClose();
});
};
addClose();