I tried to send the data with data-=""
to JavaScript so I using data-= like this in html
const detailInput = document.getElementsByClassName('avg');
const d = 0,
c = 0,
b = 0,
a = 0;
for (let input of detailInput) {
d = input.datasets.pentingd
c = input.datasets.pentingc
b = input.datasets.pentingb
a = input.datasets.pentinga
}
<input type="hidden" class="avg" data-avgpentingd="<?php $avgPuas ?>">
but it cannot be because it says undefined is not an object
. is there any solution please