This commit is contained in:
girault
2022-04-12 12:34:07 +02:00
parent d41feeffe8
commit e3c07b83d4
11 changed files with 333 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="http://www.iut-fbleau.fr/css/tacit.css">
<script src="./js/favoris.js"></script>
</head>
<body container>
<h1>Favoris</h1>
</body>
</html>

View File

@@ -0,0 +1,34 @@
let favoris = [
{
nom:"Google" ,
url:"www.google.fr",
img:"https://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/Google_2015_logo.svg/200px-Google_2015_logo.svg.png"
},
{
nom:"Le Monde",
url:"lemonde.fr",
img:"https://upload.wikimedia.org/wikipedia/commons/thumb/2/22/Lemonde_fr_2005_logo.svg/200px-Lemonde_fr_2005_logo.svg.png?uselang=fr"
},
{
nom:"L'Equipe",
url:"www.lequipe.fr",
img:"https://upload.wikimedia.org/wikipedia/commons/thumb/3/32/L%27%C3%89quipe_wordmark.svg/200px-L%27%C3%89quipe_wordmark.svg.png"
}
]
window.addEventListener("load",()=>{
// TODO
let body = document.body
let ul = document.createElement("ul")
for (f of favoris){
let li = document.createElement("li")
let a = document.createElement("a")
a.href = "http://" + f.url
let txt = document.createTextNode(f.nom)
a.appendChild(txt)
li.appendChild(a)
ul.appendChild(li)
}
body.appendChild(ul)
})