From aade7b3225501db9ded0baf68d1480a750056bf6 Mon Sep 17 00:00:00 2001 From: Ion MORARU Date: Wed, 18 Jan 2017 10:59:52 +0100 Subject: [PATCH] Resolution de l'exercice. Rajout du 3 fichier --- listjs.css | 15 +++++++++++++++ listjs.html | 17 +++++++++++++++++ listjs.js | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 listjs.css create mode 100644 listjs.html create mode 100644 listjs.js diff --git a/listjs.css b/listjs.css new file mode 100644 index 0000000..34928f9 --- /dev/null +++ b/listjs.css @@ -0,0 +1,15 @@ +div { + display: flex; + justify-content: center; +} +li { + list-style: none; +} +ul { + border: 2px solid rgb(81, 180, 164); + padding: 2%; + width: 400px; +} +.hidden { + visibility: hidden; +} diff --git a/listjs.html b/listjs.html new file mode 100644 index 0000000..bf2327a --- /dev/null +++ b/listjs.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + diff --git a/listjs.js b/listjs.js new file mode 100644 index 0000000..2abb125 --- /dev/null +++ b/listjs.js @@ -0,0 +1,43 @@ +var books = [{ + title: 'CSS: The Definitive Guide', + author: 'Eric Meyer', + link: 'http://shop.oreilly.com/product/0636920012726.do', + type: 'css' +}, { + title: 'CSS Development with CSS3', + author: 'Zachary Kingston', + link: 'http://shop.oreilly.com/product/0636920057970.do', + type: 'css' +}, { + title: 'You Don\'t Know JS: Up & Going', + author: 'Kyle Simpson', + link: 'http://shop.oreilly.com/product/0636920039303.do', + type: 'js' +}, { + title: 'Programming JavaScript Applications', + author: 'Eric Elliott', + link: 'http://shop.oreilly.com/product/0636920033141.do', + type: 'js' +}, { + title: 'Modern JavaScript', + author: 'unknown', + link: 'http://www.oreilly.com/web-platform/free/modern-javascript.csp', + type: 'js' +}]; +//Premier methode que j'ai utilise. On va trouve une autre. J'espere. + + +for (var i = 0; i < books.length; i++) { + document.write("
" + "" + "
"); +} + +// var a = books[4].type; +// console.log(a); +// function filtru(){ +// if (books[4].type === "js") { +// var b = document.getElementsByClassName('css'); +// b.css += "hidden"; +// }else if (books[4].type === "css") { +// document.querySelector(".css").addClass("hidden"); +// } +// }