ListEasy


#1

var template = function(text) {
return '

' + text + '

';
};

var main = function() {
$('form').submit(function() {
var text = $('todo').val();
var html = template(text);
$('list').append(html);
$('todo').val('');

return false;

});

$('glyphicon-star').on(function() {
$(this).toggleClass('active');
});

$('glyphicon-remove').click(function() {
$(this).remove();
});

};

$(document).ready(main);


Can anyone give me feedback on the code above?


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.