File tree Expand file tree Collapse file tree 14 files changed +180
-0
lines changed Expand file tree Collapse file tree 14 files changed +180
-0
lines changed Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="pt-br ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
6+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7+ < title > JavaScript - DOM</ title >
8+ </ head >
9+ < body >
10+
11+
12+
13+ < script src ="Aula-01.js "> </ script >
14+ </ body >
15+ </ html >
Original file line number Diff line number Diff line change 1+ //alterando título
2+ document . title = "JavaScript - DOM alterado" ;
3+
4+ //mudando background
5+ document . body . style . background = "#ccc" ;
6+ //document.body.style.backgroundImage = "url('img/tijolo.jpg')";
7+
8+ //escrever na página
9+ document . write ( "<h1>Escrevendo um título</h1>" ) ;
10+ document . write ( "<p>Escrevendo um parágrafo.</p><br>pulando linha" ) ;
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
6+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7+ < title > Document</ title >
8+ </ head >
9+ < body >
10+
11+ < p id ="idCustomizada "> 1</ p >
12+
13+ < div id ="idCustomizadaDois "> 2</ div >
14+
15+ < h1 id ="idCustomizadaTres "> 3</ h1 >
16+
17+
18+ < script src ="Aula-02.js "> </ script >
19+ </ body >
20+ </ html >
Original file line number Diff line number Diff line change 1+ // getElementById
2+ //document.getElementById('idCustomizada').innerHTML = "<b>Eu sou conteúdo HTML do JS...</b>";
3+ document . getElementById ( 'idCustomizadaDois' ) . innerText = "Eu sou um texto simples do JS..." ;
4+
5+ // com timeout
6+ setTimeout ( function ( ) {
7+ document . getElementById ( 'idCustomizada' ) . innerHTML = "<b>Eu sou conteúdo HTML do JS...</b>" ;
8+ } , 3000 ) ;
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
6+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7+ < title > Document</ title >
8+ </ head >
9+ < body >
10+
11+ < div name ="nomeDiv "> Div Um</ div >
12+ < div name ="nomeDiv "> Div Dois</ div >
13+ < div name ="nomeDiv "> Div Três</ div >
14+
15+ < script src ="Aula-03.js "> </ script >
16+ </ body >
17+ </ html >
Original file line number Diff line number Diff line change 1+ //document.getElementsByName('nomeDiv')[0].innerText = "Texto da div...";
2+ //document.getElementsByName('nomeDiv')[2].innerHTML = "<b>Div por nome no JS...</b>";
3+
4+
5+ setTimeout ( function ( ) {
6+ document . getElementsByName ( 'nomeDiv' ) [ 0 ] . innerHTML = "<b>Div por nome no JS...</b>" ;
7+ } , 3000 ) ;
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
6+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7+ < title > Document</ title >
8+ </ head >
9+ < body >
10+
11+ < p class ="minhaClasse "> 1</ p >
12+
13+ < div class ="minhaClasse "> 2</ div >
14+
15+ < h1 class ="minhaClasse "> 3</ h1 >
16+
17+
18+
19+
20+ < script src ="Aula-04.js "> </ script >
21+ </ body >
22+ </ html >
Original file line number Diff line number Diff line change 1+ document . getElementsByClassName ( 'minhaClasse' ) [ 1 ] . innerHTML = "<b>Conteúdo do inner...</b>" ;
2+ document . getElementsByClassName ( 'minhaClasse' ) [ 0 ] . innerText = "Conteúdo em texto..." ;
3+
4+
5+ setTimeout ( function ( ) {
6+ document . getElementsByClassName ( 'minhaClasse' ) [ 2 ] . innerText = "Conteúdo em texto em 3 segundos..." ;
7+ } , 3000 ) ;
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
6+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7+ < title > Document</ title >
8+ </ head >
9+ < body >
10+
11+ < h1 > 1</ h1 >
12+ < h1 > 2</ h1 >
13+ < h1 > 3</ h1 >
14+
15+ < p > 1</ p >
16+ < p > 2</ p >
17+ < p > 3</ p >
18+
19+ < div > 1</ div >
20+ < div > 2</ div >
21+ < div > 3</ div >
22+
23+ < script src ="Aula-05.js "> </ script >
24+ </ body >
25+ </ html >
Original file line number Diff line number Diff line change 1+ document . getElementsByTagName ( 'div' ) [ 1 ] . innerHTML = "Elemento por tagname" ;
2+
3+
4+ setTimeout ( function ( ) {
5+ document . getElementsByTagName ( 'p' ) [ 2 ] . innerHTML = "Aparacendo em 3 2 1...." ;
6+ } , 3000 ) ;
You can’t perform that action at this time.
0 commit comments