|
| 1 | +<!DOCTYPE html> |
| 2 | + |
| 3 | +<html> |
| 4 | +<head> |
| 5 | + <meta charset="utf-8" /> |
| 6 | + <title>page</title> |
| 7 | + <link rel="stylesheet" type="text/css" href="accordion menu 1.css"> |
| 8 | + <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 9 | + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css"> |
| 10 | + <style> |
| 11 | + </style> |
| 12 | +</head> |
| 13 | +<body> |
| 14 | + |
| 15 | + |
| 16 | + <div class="container"> |
| 17 | + <h2>WEB LANGUAGES</h2> |
| 18 | + <button class="accordion">HTML</button> |
| 19 | + <div id="box"> |
| 20 | + <p> |
| 21 | + Hypertext Markup Language is the standard text markup |
| 22 | + language used to create web pages. The last version of the |
| 23 | + language is HTML5. HTML cannot be defined as a programming language. |
| 24 | + Because a program that works on its own with HTML code can not be written. |
| 25 | + </p> |
| 26 | + </div> |
| 27 | + |
| 28 | + <button class="accordion">CSS</button> |
| 29 | + <div id="box"> |
| 30 | + <p> |
| 31 | + Cascading Style Sheets is a Web technology that offers additional |
| 32 | + possibilities for formatting text and formats in addition to HTML. |
| 33 | + </p> |
| 34 | + </div> |
| 35 | + |
| 36 | + <button class="accordion">JavaScript</button> |
| 37 | + <div id="box"> |
| 38 | + <p> |
| 39 | + JavaScript® (usually abbreviated as js) is an object-oriented programming |
| 40 | + language that is simply interpreted and blended with first-class functions. |
| 41 | + It is commonly known as a scripting language for web pages, but is often |
| 42 | + used in non-browser environments such as node.js or Apache CouchDB. Having |
| 43 | + a prototype-based and multi-paradigm language provides a dynamic and |
| 44 | + functional structure. Learn more about JavaScript. |
| 45 | + </p> |
| 46 | + </div> |
| 47 | + </div> |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + <script> |
| 52 | + |
| 53 | + let acordion = document.getElementsByClassName("accordion"); |
| 54 | + |
| 55 | + |
| 56 | + for (let i = 0; i < acordion.length; i++) { |
| 57 | + acordion[i].addEventListener("click", function () { |
| 58 | + this.classList.toggle("active"); |
| 59 | + let box = this.nextElementSibling; |
| 60 | + if (box.style.display === "none") { |
| 61 | + box.style.display = "block"; |
| 62 | + } |
| 63 | + else { |
| 64 | + box.style.display = "none" |
| 65 | + } |
| 66 | + }) |
| 67 | + }; |
| 68 | + |
| 69 | + |
| 70 | + </script> |
| 71 | + |
| 72 | +</body> |
| 73 | +</html> |
0 commit comments