When I add this part of code to the script it doesn't display the Date and time:
var d = new Date();
var $fulaDate = $(d.getFullYear() + "-" + d.getMonth()
+ "-" + d.getDate() + "T" + d.getHours() + ":" + d.getMinutes()
+ ":" + d.getSeconds()).appendTo(div);
I Can't figure out what the problem is.
JQuery
function addComment(name1) {
var container = $('#divComments');
var inputs = container.find('label');
var id = inputs.length + 1;
var div = $('<div />', { class: 'CommentStyle' });
$('<label />', {
id: 'comment' + id,
text: name1
}).appendTo(div);
var d = new Date();
var $fulaDate = $(d.getFullYear() + "-" + d.getMonth() + "-" + d.getDate() + "T" + d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds()).appendTo(div);
div.appendTo(container);
}
$('#submit').click(function () {
addComment($('#comments').val());
$('#comments').val("");
});