Wednesday, July 24, 2019

How we Change Colour and Size of text in JavaScript

Change Colour and Size of text



CODE

change.html

<html>
<head>
<title> Change Color</title>
<script>
function ChangeColor(){
var x = document.getElementById('changecolor');
x.style.fontSize="25px";
x.style.color="red";
}

</script>
</head>
<body>
<p id="changecolor"> WELCOME</p>
<button type="button" onclick="ChangeColor()">Change</button>

</body
</html>
Try it Yourself »




OUTPUT



Change Color
WELCOME



No comments:

Post a Comment