In jQuery, you can set CSS properties on an element using the css() method. To achieve the same thing in vanilla JavaScript, you can use the style property of the element.
Source code viewer
// Get styles. var elementStyle = getComputedStyle(window.document.querySelector('.my-class-name')); // Add/edit style. window.document.querySelector('.my-class-name').style.backgroundColor = 'red'; // Delete style. window.document.querySelector('.my-class-name').style.backgroundColor = '';Programming Language: Javascript