Home > Mobile >  How can I manipulate HTML DOM with data from Database and Node (Mongoose)
How can I manipulate HTML DOM with data from Database and Node (Mongoose)

Time:06-15

I'm coding something that has a Star review feature. I want to change the width(through document.querySelector('').style.width = starPercentage) of elements to determine how many stars a review gave, and I'm getting the data from mongoose and express. What's the best way to manipulate the stars of each review?

CodePudding user response:

The following article contains simple technique for filling star ratings in Javascript. https://webdesign.tutsplus.com/tutorials/a-simple-javascript-technique-for-filling-star-ratings--cms-29450

CodePudding user response:

CSS

and add the correct css to the html class tag for example ( , ....)

  • Related