Monday, February 9, 2015

JavaScript Can Change HTML Styles

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>


Asp.net Related Post :


No comments:

Post a Comment