JavaScript Can Change HTML Styles:
In this post i want to change style of html content by javascript on button click.
<html>
<body>
<h1>Change css by JavaScript Do?</h1>
<p id="htmlp"> hello friend the content style will be
change on button click</p>
<script>
function myJavascript_Function() {
var x = document.getElementById("htmlp");
x.style.fontSize = "20px";
x.style.color = "green";
}
</script>
<button type="button" onclick="myJavascript_Function()">Click here
For Change</button>
</body>
</html>
No comments:
Post a Comment