How JavaScript can change the style of an HTML element

Javascript / Fundamentals of Javascript

373

Program:

<!DOCTYPE html>
<html>
<body>

<h2>What Can JavaScript Do?</h2>

<p id="demo">JavaScript can change the style of an HTML element.</p>

<button type="button" onclick="document.getElementById('demo').style.fontSize='40px'">Click Me!</button>

</body>
</html> 

Output:

Run above code

Explanation:

no

This Particular section is dedicated to Programs only. If you want learn more about Javascript. Then you can visit below links to get more depth on this subject.