diff --git a/.gitignore b/.gitignore index c2658d7..07e6e47 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -node_modules/ +/node_modules diff --git a/index.html b/index.html index 06434eb..0c53245 100644 --- a/index.html +++ b/index.html @@ -5,24 +5,30 @@ - + javascript test -

webside test mit node backend

- - - - - - - - - - - - - -
test1coltest2coltest3col
testrow7bla
+
+

webside test mit node backend

+
+ + +
+ + +
+
+ + + + + + + + + +
idtext
+
diff --git a/main.js b/main.js index 7a16e59..29db22d 100644 --- a/main.js +++ b/main.js @@ -15,3 +15,24 @@ function redBg() { isRed = false; } } + +const addButton = document.getElementById('addButton'); +addButton.addEventListener('click', handleInput); + +let i = 0; + +function handleInput() { +const inputText = document.getElementById('inputText').value; +/*alert(inputText);*/ +const table = document.getElementById('contentTable'); +const newRow = table.insertRow(); + +i++; + +newRow.insertCell(0).textContent = i; +newRow.insertCell(1).textContent = inputText; + + +}; + + diff --git a/style.css b/style.css index d201d69..cbe50ec 100644 --- a/style.css +++ b/style.css @@ -6,3 +6,19 @@ button.center { display: block; margin: 0 auto; } + +.head-col { + background-color: gray; +} + +.adding { + display: flex; + justify-content: center; + gap 10px; +} + +.inputTable { + display: flex; + justify-content: center; + gap 10px; +}