I want to get the value of a span attribute in a div. That div is part of a LI attribute. The li attributes are created with javascript (for full code, beneath). This is the html I have:

```
<ul name="products">
<li class="product" name="product2">
<input type="hidden" name="p2" value="Boter_250g/3/9.00">
<div class="product-image"></div>
<div class="product-details">
<a style="color: black;">Boter 250g</a>
<span class="price">€ 9.00</span>
<div class="quantity">
</div>
</div>
</li>
</ul>

```

**Things I tried**

```
        productTotPrice = Number($(this).find('.price').text().replace('€', ''));

```

or 

```
Number($(this).find('.product-details').text().replace('€', ''))

```

that always give "0"

js: 

```
function addProduct() {
        var product = products[type];
        var productname = product.replace(/_/g, " ");

        var productAdded = $('<li class="product" name="product' + i + '">' +
            '<input type="hidden" name="p' + i + '"value="' + product + "/" + qty + "/" + price + '" />'    +
            '<div class="product-image">' +
            '<a href="image">' +
            '<img src="images/' + product + '.JPG" alt="placeholder"></a>' +
            '</div>' +
            '<div class="product-details">' +
            '<a style="color: black;">' + productname + '</a>' +
            '<span class="price">€ ' + price + '</span><br>' +
            '<div class="quantity">' +
            '<label>Aantal: ' + qty + '</label> <div class="actions">' +
            ' <a href="#0" class="delete-item" >Delete</a></div></div></div></li>');

        cartList.prepend(productAdded);

    }

```