change style of an html element with javascript code example
Example 1: style through javascript
element.style.backgroundColor = "red"; // set the background color of an element to red
Example 2: change style js
// select element from DOM
const el = document.querySelector('.para')
// change css style
el.style.color = 'purple'