<p id="catSentence">I love cute cats.</p>
<button id="catButton">Change style of sentence</button>
#catSentence{background:red;}
var changeSentence = document.querySelector('#catSentence');
var catButton = document.querySelector('#catButton');
    
catButton.addEventListener('click', function() { changeSentence.style.background = 'yellow';
changeSentence.style.fontWeight = 'bold';
changeSentence.style.fontSize = '2.5em';
})

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.