informaticage

aoclel loop js html

Apr 6th, 2021
387
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html lang="en">
  2.   <head>
  3.     <meta charset="UTF-8" />
  4.     <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6.     <title>LEL</title>
  7.   </head>
  8.   <body>
  9.     <section id="items"></section>
  10.  
  11.     <script>
  12.       const items = [
  13.         { title: "Titolo 1", price: 12 },
  14.         { title: "Titolo 2", price: 14 },
  15.         { title: "Titolo 3", price: 17 },
  16.       ];
  17.       const itemsHtml = items.map(
  18.         (item) =>
  19.           `<section>
  20.             <header>${item.title}</header>
  21.             <main>${item.price}</main>
  22.           <section>`
  23.       );
  24.  
  25.       const itemsContainer = document.querySelector("#items");
  26.       itemsContainer.innerHTML = itemsHtml.join('<br>');
  27.     </script>
  28.   </body>
  29. </html>
  30.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×