Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67441

how to print whole array of object properties value in vanila js

$
0
0

just like angular *ngFor, I want to implement in vanila js and print whole array of object properties on one div

I have tried this but this doesn't work for me

for(let skipques of arr){
    var elem = document.createElement("p");
    elem.setAttribute('Id',arr.ques);
    document.body.appendchild(elem);
}
let arr = [
    {ques: 2},
    {ques: 5},
    {ques: 8},
    { ques: 10}
];

<div id="questId"></div>

I want to list all ques value on div because this array of object is dynamic


Viewing all articles
Browse latest Browse all 67441

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>