-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain-no-compress.js
More file actions
60 lines (42 loc) · 1.49 KB
/
Copy pathmain-no-compress.js
File metadata and controls
60 lines (42 loc) · 1.49 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*Get information all cells*/
$(document).keyup(function() {
var tdRows = $('#inputTd').val();
var trColl = $('#inputTr').val();
var tdRows = $('#inputTd').val();
var allCells = trColl * tdRows;
$('.allCells').text(allCells);
});
/*Get information user input*/
$(document).ready(function() {
$("#inputTr").keyup(function() {
$(".resultTr").text($("#inputTr").val());
});
$('#inputTd').keyup(function() {
$('.resultTd').text($('#inputTd').val());
$('#result').show();
});
});
/*Tables generation last version*/
$(window).on('load', function() {
$('#btn').click(function() {
$('#tablesSource').empty();
$('#tablesCode').empty();
$('#tablesResult').show();
var trColl = $('#inputTr').val();
var tdRows = $('#inputTd').val();
$('#tablesSource').append('<table>');
$('#tablesCode').append('<table>');
for (a = 1; a <= tdRows; a++) {
$('#tablesSource').append('<tr>');
$('#tablesCode').append('<tr>');
for (b = 1; b <= trColl; b++) {
$('#tablesSource').append('<td>' + b + '\) result' + '</td>');
$('#tablesCode').append('<td>' + b + '\) result ' + '</td>');
}
$('#tablesSource').append('</tr>');
$('#tablesCode').append('</tr>');
}
$('#tablesSource').append('</table>');
$('#tablesCode').append('</table>');
});
});