<div class="col-md-12">
<div class="card" id="count_one">
<input type="hidden" class="idspeed" value="0.0000397938144330" />
<div class="card-body">
<div class="media align-items-center">
<input type="hidden" class="idfloat" value="10.000067981099106">
<div class="media-body">
<span data-Count>10.00009856</span>
<span data-Price>0.50</span>
<span data-Cash>5.00006288</span>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="card" id="count_two">
<input type="hidden" class="idspeed" value="0.0000000020431799" />
<div class="card-body">
<div class="media align-items-center">
<input type="hidden" class="idfloat" value="100.00004564566">
<div class="media-body">
<span data-Count>100.00009856</span>
<span data-Price>10.50</span>
<span data-Cash>1050.0004567456</span>
</div>
</div>
</div>
</div>
</div>
$(document).ready(function () {
let cards = document.querySelectorAll('.card')
setInterval(function () {
cards.forEach (card => {
const renderSpeed = card.querySelector('.idspeed').value;
const renderPrice = card.querySelector('[data-Price]');
const renderCount = card.querySelector('[data-Count]');
const test = card.querySelector('.idfloat');
const RenderSum = card.querySelector('[data-Cash]');
test.value = parseFloat(renderSpeed / 600) + parseFloat(test.value)
renderCount.textContent = parseFloat(test.value).toFixed(8)
RenderSum.textContent = parseFloat(parseFloat(renderCount.textContent) * parseFloat(renderPrice.textContent)).toFixed(8)
})
} , 100)
});
Все вроде работает правильно ,но куча ошибок
Uncaught TypeError: Cannot read property 'value' of null
at const renderSpeed = card.querySelector('.idspeed').value;
at NodeList.forEach (<anonymous>)
at cards.forEach (card => {
const renderSpeed = card.querySelector('.idspeed').value;