1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <html>
<head>
<title>Display a table</title>
</head>
<body>
<p id="Hello" onmouseover="change(this)">Hello How are you doing</p>
<script>
function change(obj){
obj.style.margin = "90px";
obj.style.fontSize = obj.style.fontSize == "200%" ? "300%" : "200%";
obj.style.color= obj.style.color=="green" ? "red" : "green";
}
</script>
</body>
</html>
|
Change Font Size and Color of text using Java Script
Change the font size and color of the text using java script We use onmouseover in this example code. You can use onClick and onmouseout too.
Sagar Devkota
Hello This is Sagar Devkota. Studying Bachelor of Software Engineering at Pokhara University. I know something about Linux, Android, Java, Nodejs, Unity3D and 3 dots :)
0 comments:
Post a Comment