Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<header class="product__list-header">
    <h2>Webshop</h2>
</header>
<section class="product__list">
  <div class="product__item">
    <img src="http://lorempixel.com/400/200/food" class="product__image" alt="Food">
    <span class="product__price">500</span>
  </div>
  <div class="product__item fun__class">
    <img src="https://lorempixel.com/400/200/food" class="product__image" alt="Food">
    <span class="product__price">500</span>
  </div>
  <div class="product__item">
    <img src="https://lorempixel.com/400/200/food" class="product__image" alt="Food">
    <span class="product__price">500</span>
  </div>
  <div class="product__item">
    <img src="https://lorempixel.com/400/200/food" class="product__image" alt="Food">
    <span class="product__price">500</span>
  </div>
  <div class="product__item">
    <img src="https://lorempixel.com/400/200/food" class="product__image" alt="Food">
    <span class="product__price">500</span>
  </div>
</section>
</body>
</html>
 
var productList = document.querySelector('.product__list').children;
/* Check https://www.w3schools.com/jsref/dom_obj_all.asp    */
console.log('productList: ', productList);
for (i = 0; i < productList.length; i++) { 
  console.log('productList[i]: ', productList[i]);
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
raymonschouwenaarpro
0viewers