From 4bc8d77e0597781f0d497de9f90f025e8acc26b4 Mon Sep 17 00:00:00 2001
From: JeanBerly <68441010+JeanBerl@users.noreply.github.com>
Date: Mon, 13 Jun 2022 15:57:02 -0300
Subject: [PATCH 1/4] Lidando com tabelas feito
---
atividade.js | 11 +++++++++++
index.html | 20 ++++++++++++++++++++
2 files changed, 31 insertions(+)
create mode 100644 atividade.js
create mode 100644 index.html
diff --git a/atividade.js b/atividade.js
new file mode 100644
index 0000000..7ea9ba8
--- /dev/null
+++ b/atividade.js
@@ -0,0 +1,11 @@
+function fazTabela(){
+ let texto = document.getElementById("entrada").value;
+ let arrayValores = texto.split(",")
+ let tabela = `
`;
+ arrayValores.forEach((value) =>{
+ tabela += `| ${value} |
`;
+ })
+ tabela += `
`
+ document.body.innerHTML += tabela;
+ console.log(tabela)
+}
\ No newline at end of file
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..3e3ba3f
--- /dev/null
+++ b/index.html
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+ E06-JS
+
+
+
+
+
+
+
\ No newline at end of file
From 52618589e194a1dbbc5d8628f4605419f37a332a Mon Sep 17 00:00:00 2001
From: JeanBerly
Date: Fri, 17 Jun 2022 10:57:53 -0300
Subject: [PATCH 2/4] getByName feito
---
atividade.js | 16 ++++++++++++++++
index.html | 3 +++
2 files changed, 19 insertions(+)
diff --git a/atividade.js b/atividade.js
index 7ea9ba8..0d6c446 100644
--- a/atividade.js
+++ b/atividade.js
@@ -8,4 +8,20 @@ function fazTabela(){
tabela += ``
document.body.innerHTML += tabela;
console.log(tabela)
+}
+// getByName(elem)
+function getElementsByTagName(tag){
+ let elementsWithTag = [];
+ recursiveSearch(document.body, tag, elementsWithTag);
+ return elementsWithTag;
+}
+function recursiveSearch(node, tag, arrayElements){
+ if (node.childNodes.length != 0){
+ node.childNodes.forEach((childNode) =>{
+ if (childNode.tagName != undefined) recursiveSearch(childNode, tag, arrayElements);
+ })
+ }
+ if (node.tagName == tag){
+ arrayElements.push(node);
+ }
}
\ No newline at end of file
diff --git a/index.html b/index.html
index 3e3ba3f..367a821 100644
--- a/index.html
+++ b/index.html
@@ -16,5 +16,8 @@
+
+
+