how to set percentage in java script for dom code example Example: percentage formula in javascript const result = Math.round((data.expense / data.income) * 100)