Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- $('<fieldset>').appendTo('body');
- $('<div>').addClass('table-title').appendTo('fieldset');
- $('<h3>Список: </h3>').appendTo('.table-title');
- $('<div>').appendTo('.table-title');
- $('<label>Дело: </label>').appendTo('.table-title > div');
- $('<input></input>').attr('id', 'text').attr('type', 'text').appendTo('label');
- $('<input></input>').attr('id', 'plus').attr('type', 'button').attr('value', 'Добавить').appendTo('label');
- $('<table>').height('auto').attr('id', 'myTable').addClass('table-fill').appendTo('fieldset');
- $('<tr>').appendTo('table');
- $('<th>№</th>').addClass('list_link').appendTo('tr');
- $('<th>Описание</th>').addClass('list_link').appendTo('tr');
- $('<th>Действие</th>').addClass('list_link').appendTo('tr');
- var number = 0;
- $('#plus').click(function(){
- number++;
- var task = $('#text').val();
- $('<tr>').appendTo('table');
- $('<th></th>').text(number).appendTo('tr:last-child');
- $('<th></th>').text(task).addClass('task').appendTo('tr:last-child');
- $('<th></th>').appendTo('tr:last-child');
- $('<label>Выполнено</label>').appendTo('tr:last-child > th:last-child');
- $('<input>').attr('type', 'checkbox').appendTo('tr:last-child > th:last-child');
- $('input[type = checkbox]').click(function(){
- if ($('input:checkbox:checked')) {
- $('.task').addClass('thro');
- }
- })
- });
- })
- $('input[type=checkbox]')
- $('input[type=checkbox]', el)
- el.find('input[type=checkbox]')
Add Comment
Please, Sign In to add comment