Source Code:
(back to article)
Submit
Result:
Report an issue
<div id="stylePropertyExample">This text will be styled using JavaScript.</div> <button onclick="applyStyleProperty()">Apply Style Property</button> <script> function applyStyleProperty() { const element = document.getElementById('stylePropertyExample'); element.style.color = 'blue'; element.style.fontSize = '18px'; element.style.margin = '10px'; } </script>