My first time on stackoverflow. I tried to find an answer on previous posts but still looking for a solution.
I try to get the order delay displayed for each items on my product list.
I'm not able to get the proper delay for each product, only the first delay is assigned on all products.
PS: The number of products is variable.
<html>
<head>
<script src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
<script>
$(document).ready(function() {
var skuDelay = $("div").attr("orderDelay");
$("p").after("<br>DELAY "+ skuDelay +" DAYS");
console.log("skuDelay = " + skuDelay)
});
</script>
</head>
<body>
<div orderDelay="4-6"><h3>Product 1</h3>
<p>Price = 10.40$</p>
</div>
<br><br>
<div orderDelay="8-10"><h3>Product 2</h3>
<p>Price = 9.30$</p>
</div>
<br><br>
<div orderDelay="14-21"><h3>Product 3</h3>
<p>Price = 14.40$</p>
</div>
</body>
</html>
This is HTML Result =
Product 1 Price = 10.40$ DELAY 4-6 DAYS
Product 2 Price = 9.30$ DELAY 4-6 DAYS
Product 3 Price = 14.40$ DELAY 4-6 DAYS
Thanks!
DELAY "+ skuDelay+ " DAYS"); }}); – Philippe Jan 28 '20 at 17:30