diff --git a/bolso.jpg b/bolso.jpg new file mode 100644 index 0000000..b4967b2 Binary files /dev/null and b/bolso.jpg differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..2c5c2db --- /dev/null +++ b/index.html @@ -0,0 +1,46 @@ + + + + + + + + + + + + E06 + + +
+
+

E10

+
+
+
+
+

Tabela

+ +
+ + + + + +
+
+
+

GetName

+ +
+ +
+
+

Esconder imagens

+ bozo + lula + +
+
+ + \ No newline at end of file diff --git a/lula.jpg b/lula.jpg new file mode 100644 index 0000000..ad152cb Binary files /dev/null and b/lula.jpg differ diff --git a/main.js b/main.js new file mode 100644 index 0000000..5e1fdb1 --- /dev/null +++ b/main.js @@ -0,0 +1,79 @@ +function transformaImg(){ + //Remover as imagens + var pai = document.getElementById("div1"); + var filho = document.getElementsByTagName("img"); + while(filho.length > 0){ + console.log(filho.length); + pai.removeChild(filho[0]); + } + + //descrição da imagem 1 + var QuebraLinha = document.createElement("br"); + var criaElem = document.createElement("p"); + var node = document.createTextNode("Bozo"); + criaElem.appendChild(node); + criaElem.appendChild(QuebraLinha); + var elem = document.getElementsByTagName("div"); + elem[0].appendChild(criaElem); + + //descrição da imagem 2 + QuebraLinha = document.createElement("br"); + criaElem = document.createElement("p"); + node = document.createTextNode("lula"); + criaElem.appendChild(node); + criaElem.appendChild(QuebraLinha); + elem = document.getElementsByTagName("div"); + elem[0].appendChild(criaElem); +} + +function transformaTexto(texto){ + var vetorTexto=[]; + var lines = texto.split('\n'); + for(i=0; i < lines.length; i++){ + vetorTexto[i] = lines[i].split(','); + } + return vetorTexto; +} + +function resultado(){ + var tbl = document.getElementsByTagName("table")[0]; + var text = document.getElementsByTagName("textarea")[0].value; + var Tabela = transformaTexto(text); + while(tbl.childNodes.length>0){ + tbl.removeChild(tbl.childNodes[0]); + } + for(i = 0; i < Tabela.length;i++){ + var li = document.createElement("tr"); + for( w = 0; w < Tabela[i].length; w++){ + var colunas = document.createElement("td"); + var value = document.createTextNode(Tabela[i][w]); + colunas.appendChild(value); + li.appendChild(colunas); + } + tbl.appendChild(li); + + } +} + +function getByName(elem) +{ + var array = [] + busca(document.body, elem.toUpperCase(), array) + return array +} + +function busca(node, tag, arrayElements) +{ + for (var filho of node.childNodes) + { + if (filho.childNodes.length != 0) + { + busca(filho, tag, arrayElements) + } + if (filho.tagName == tag) + { + arrayElements.push(filho) + } + } + return arrayElements +} \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..8d878fe --- /dev/null +++ b/style.css @@ -0,0 +1,27 @@ +*{ + margin: auto; + padding: 10px; +} + +header{ + display: block; + position: center; + background-color: aliceblue; +} + + +h1{ + color: rgb(226, 143, 222); + position: center; + display: block; +} + +h2{ + position: center; +} + +img{ + height: 200px; + width: 200px; +} +