A Pen by Danny

Thumbnail
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 ©

Technologies

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

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

<body>

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



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



    <div>
        <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>
    </div>



    <div>
        <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>
    </div>
    </div>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script>

  

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




</body>

</html>

/*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>" );

Comments