Home  • University • Campus

Use of JavaScript Function

doctype-html-head-title
<!doctype>
<html>
<head>
<title></title>
</head>
<body>
<p id="color" style="font-size:20px">I Love My Country</p>

<script>
function mamun(){
var x=document.getElementById('color');
x.style.fontSize="30px";
x.style.color="red";
}

function mamunPre(){
var x=document.getElementById('color');
x.style.fontSize="20px";
x.style.color="black";
}
</script>

<button onclick="mamun()">Color change</button>
<button onclick="mamunPre()">Previous</button>

</body>
</html>

Comments 0


Share

About Author
Abdullah Al Mamun
Copyright © 2024. Powered by Intellect Software Ltd