Source Code:
(back to article)
Submit
Result:
Report an issue
<div id="inlineStyleExample">This text will be styled using inline styles.</div> <button onclick="applyInlineStyle()">Apply Inline Style</button> <script> function applyInlineStyle() { const element = document.getElementById('inlineStyleExample'); element.style.color = 'red'; element.style.fontSize = '20px'; } </script>