Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>My First JavaScript</h1>
<p id="demo">JavaScript can change the style of an HTML element.</p>
<script>
function myFunction() {
document.getElementById("demo").style.fontSize = "25px";
document.getElementById("demo").style.color = "red";
document.getElementById("demo").style.backgroundColor = "yellow";
}
</script>
<button type="button" onclick="myFunction()">Click Me!</button>
</body>
</html>
Basic Example of A Taste of JavaScript | HTML JavaScript |
Full Example of A Taste of JavaScript | HTML JavaScript |
JavaScript can change attributes: | HTML JavaScript |
What is HTML JavaScript | HTML JavaScript |
How to use The HTML <script> Tag | HTML JavaScript |
How to create A Taste of JavaScript | HTML JavaScript |
How to create The HTML <noscript> Tag | HTML JavaScript |
Type: | Html |
Category: | Web Tutorial |
Sub Category: | HTML JavaScript |
Uploaded by: | Admin |