A Pen by Danny

This awesome code was written by dannykorf, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright dannykorf ©


  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

  <meta charset="UTF-8">
  <title>A Pen by  Danny</title>


  <div class="product-properties">
        <strong>Soort</strong> <span><a class="active" href="/zoeken/?q=sauvignon blanc">sauvignon blanc</a></span>

        <strong>Inhoud - %</strong> <span>75CL - 12% Vol</span>

        <strong>Smaak</strong> <span><a class="active" href="/zoeken/?q=groene appel">groene appel</a>, <a class="active" href="/zoeken/?q=kruisbessen">kruisbessen</a> en <a class="active" href="/zoeken/?q=sappig">sappig</a></span>

        <strong>Lekker bij</strong> <span><a class="active" href="/zoeken/?q=geitenkaas">geitenkaas</a>, <a class="active" href="/zoeken/?q=salades">salades</a> en <a class="active" href="/zoeken/?q=sushi">sushi</a></span>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script>


    <script  src="js/index.js"></script>



/*Downloaded from https://www.codeseek.co/dannykorf/a-pen-by-danny-zRYxmj */
let indicator = "<span>^fles icoon^</span>"
let hoeveelheid = $( ".product-properties div span" )[1].innerHTML;
let myMatch = hoeveelheid.match(/^\d{2,3}(?=CL)/g);
var glazen = myMatch/15;

var glas = indicator * glazen 

$( ".product-properties" ).append( "<div><strong>Glazen per fles</strong>" + glas + "</div>" );