Created
August 2, 2016 22:50
-
-
Save renoirtech/5308843b0c9ef8918679b04d5a2122c5 to your computer and use it in GitHub Desktop.
Revisions
-
Renoir Faria created this gist
Aug 2, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ // DECLARAÇÃO DE VARIÁVEIS var tabela = document.getElementById('table-apps'); var $a = tabela.getElementsByTagName('A'); var body = document.getElementsByTagName('BODY'); body = body[0]; //FUNÇÕES function criaTexto(texto){ // CRIAÇÃO DE ELEMENTOS DOM quebraLinha = document.createElement('br'); texto = document.createTextNode(texto); // INSERÇÃO DE ELEMENTOS DOM body.appendChild(texto); body.appendChild(quebraLinha); } // CAPTURA DE TITULO DOS JOGOS for(var i = 0; i<$a.length; i++){ if(i% 2) { texto = $a[i].text; criaTexto(texto); } } alert("Sucesso"); //FIM DO CÓDIGO.