-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmyQuery.js
More file actions
41 lines (36 loc) · 928 Bytes
/
myQuery.js
File metadata and controls
41 lines (36 loc) · 928 Bytes
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
33
34
35
36
37
38
39
40
41
// TargetTrust
var dadosDB = ["Arno","Daniel", "Samuel", "Vinicius", "Gianfranco"];
function legal(){
for(i=0; i<dadosDB.length;i++){
document.body.innerHTML += " <p>" + dadosDB[i] + "</p>";
}
}
$(function(){
legal();
$("p").css("margin",2).css("padding",2);
$("p:even").css("background","#CCC");
$("p:odd").css("background","#EEE");
$("p").click(
function(){
$(this).hide(1000);
}
);
$("p:first").click(
function(){
$("p").show(1000);
}
);
var lista = document.createElement("ul");
for(i=0;i<dadosDB.length;i++){
var itens = document.createElement("li");
var urls = document.createElement("a");
urls.innerHTML = dadosDB[i];
itens.appendChild(urls);
lista.appendChild(itens);
};
document.body.appendChild(lista);
$("ul").attr("id","listagem");
$("#listagem li").addClass("alunos").find("a").each(function(){
$(this).attr("href","/"+$(this).text());
});
});