diff options
author | SiemV <swl.vermeulen@student.avans.nl> | 2024-03-19 21:26:23 +0100 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2024-03-19 21:26:23 +0100 |
commit | ccbf5f66f88f66e98bfa2d566524cd5636b5d8ee (patch) | |
tree | 7dde065669d0624d045ed6395daa41973a0d3633 /ui/script.js | |
parent | af9a3231f3174fd04082b75eddb6a6c6d57654ef (diff) |
Add files from Siem
Diffstat (limited to 'ui/script.js')
-rw-r--r-- | ui/script.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ui/script.js b/ui/script.js new file mode 100644 index 0000000..6a5e457 --- /dev/null +++ b/ui/script.js @@ -0,0 +1,15 @@ +// Initialize a counter to keep track of the row number
+var rowCount = 1;
+
+// JavaScript for adding a row dynamically at the top
+document.getElementById("addRowBtn").addEventListener("click", function() {
+ var table = document.getElementById("myTable");
+ var row = table.insertRow(1); // Insert row at the top of the table
+ var cell = row.insertCell(0); // Insert cell into the row
+ cell.innerHTML = "Hallo siem ik ben dit aan het testen. er blijven maar 10 statussen in deze tabel " + rowCount++; // Add content to the cell with incremented counter
+ var size = table.rows.length;
+ var lastRowIndex = table.rows.length - 1; // Index of the last row
+ if (size > 11) { // Check if there is more than one row (excluding the header row)
+ table.deleteRow(lastRowIndex); // Delete the last row
+ }
+});
|