maxim1978,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
div:after {
content: attr(data-price);
}
</style>
</head>
<body>
<script>
let obj = [{
name: "",
average: "",
cpu: "",
price: "1",
}, {
name: "",
average: "",
cpu: "",
price: "2",
}, {
name: "",
average: "",
cpu: "",
price: "3",
}, {
name: "",
average: "",
cpu: "",
price: "4",
}]
for (const inf of obj) {
let d = document.createElement("div");
Object.assign(d.dataset, inf);
document.body.append(d);
}
</script>
</body>
</html>