<p id="styledText">This text will be styled.</p>
<button onclick="changeStyle()">Change Style</button>
<script>
function changeStyle() {
document.getElementById('styledText').style.color = "red";
document.getElementById('styledText').style.fontSize = "24px";
}
</script>
JavaScript can respond to user actions (events) such as clicking a button, typing in a text box, or submitting a form.