Skip to content

DOM-CSS #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions JavaScript/Advance/DOM/6. DOM CSS/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DOM-CSS</title>
<link rel="stylesheet" href="style.css">
</head>

<body>
<h1>DOM CSS</h1>
<h2>Example One</h2>
<p id="textOne">Hello there</p>
<button onclick="DisplayOne()">Click</button>
<h2>Example Two</h2>
<p id="textTwo">Hello there</p>
<button onclick="DisplayTwo()">Click</button>
<h2>Example Three</h2>
<p id="textThree">Hello there</p>
<button onclick="DisplayThree()">Click</button>
<script src="script.js"></script>
</body>

</html>
20 changes: 20 additions & 0 deletions JavaScript/Advance/DOM/6. DOM CSS/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
let textOne = document.getElementById('textOne');

function DisplayOne() {
textOne.style.color = "red";
}

let textTwo = document.getElementById('textTwo');

function DisplayTwo() {
textTwo.style.fontSize = "30px";
}

let textThree = document.getElementById('textThree');

function DisplayThree() {
textThree.style.fontFamily = "monospace";
textThree.style.fontSize = "30px";
textThree.style.color = "blue";
textThree.style.fontWeight = "700";
}
3 changes: 3 additions & 0 deletions JavaScript/Advance/DOM/6. DOM CSS/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
h2 {
font-family: monospace;
}