How to limit the script within a div?

There is an HTML code, there are two main <div class="title-price">inside them div-s with the same classes, but with a different value inside diva <div class="belrub"> (this value further multiplies the script and displays the result inside the other div s):

<div class="title-price">Advice
<div class="belrub">77</div>
<div class="valusd"></div>
<div class="valrub"></div>
<div class="valeur"></div>
</div>

<div class="title-price">Lachenaie
<div class="belrub">500</div>
<div class="valusd"></div>
<div class="valrub"></div>
<div class="valeur"></div>
</div>

<div class="nulvalusd">2</div>
<div class="nulvalrub">3</div>
<div class="nulvaleur">4</div>


Script multiplication looks like this:
the <script> 
$('.title-price').ready(function(){
 var price = $(this).find('.belrub').html(); 
 price=price.replace(/RUB\./, "")
 price=price.replace(/ /, "")
 var day = $(this).find('.nulvalusd').html(); 
 day=day.replace(/name\./, "");
sum=Math.round((price)/day);
 $(this).find('.valusd').html(sum+" USD");

 var price = $(this).find('.belrub').html(); 
 price=price.replace(/RUB\./, "")
 price=price.replace(/ /, "")
 var day = $(this).find('.nulvalrub').html(); 
 day=day.replace(/name\./, "");
sum=Math.round(day*(price)*10);
 $(this).find('.valrub').html(sum+" RUB");

 var price = $(this).find('.belrub').html(); 
 price=price.replace(/RUB\./, "")
 price=price.replace(/ /, "")
 var day = $(this).find('.nulvaleur').html(); 
 day=day.replace(/name\./, "");
sum=Math.round((price)/day);
 $(this).find('.valeur').html(sum+" EUR");

});
</script>


The problem is that the second <div class="title-price"> results
<div class="valusd"></div>
<div class="valrub"></div>
<div class="valeur"></div>
displayed amount multiplied by <div class="belrub">77</div> of first <div class="title-price">.

Tell me how to limit the script within each <div class="title-price">to perennials inside your div-a?
April 3rd 20 at 18:32
1 answer
April 3rd 20 at 18:34
Alternatively, the elements within each diva with class title-price, give individual classes.
For example:
<div class="title-price">Advice
<div class="belrub">77</div>
<div class="valusd"></div>
<div class="valrub"></div>
<div class="valeur"></div>
</div>

<div class="title-price">Lachenaie
<div class="belrub belrub1">500</div>
<div class="valusd valusd1"></div>
<div class="valrub valrub1"></div>
<div class="valeur valeur1"></div>
</div>

And write the appropriate JavaScript code for the new classes.
This is nonsense, there is enough to make a normal layout, and the code is multiplying it will be in 1~3 lines.
Yesterday I already gave the answer. - maxwell.Pollich commented on April 3rd 20 at 18:37
@maxwell.Pollich, and you can link to the code? Interesting - Kadi commented on April 3rd 20 at 18:40
@Kadi, How to multiply element values in classes? - maxwell.Pollich commented on April 3rd 20 at 18:43

Find more questions by tags JavaScript