-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex03.js
32 lines (23 loc) · 1.05 KB
/
ex03.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* Faca uma funcao que receba um vetor de Strings
via parametro e monte uma página contendo essas strings
dentro de uma div para cada uma. */
function teste(){
var stringVet = ["Olar!",
"Como vai?",
"Tá tranquilo!",
"Tá favorável!",
"É nois que voa!"];
ex03(stringVet);
}
function ex03(stringVet){
var total = stringVet.length;
var i = 0;
while (i<total){
var div = document.createElement('div');
div.innerHTML = "<p>" + stringVet[i] + "</p>";
div.style.border = "1px solid #bdd";
document.body.appendChild(div);
i++;
}
}
teste();