Skip to content
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

Tasks by Abhishek Shyam #4

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Task-2 mutating DOM
  • Loading branch information
abhibenne committed Jan 4, 2022
commit 03caad18a155195e1d50ab9df3207bb7b1c78849
64 changes: 64 additions & 0 deletions Task-2/task-2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!DOCTYPE html>
<html>
<head>
<script>
function toggleMe()
{
let visible = document.getElementById('test').style.visibility;
if(visible == 'hidden')
{
document.getElementById('test').style.visibility = 'visible';
}
else
{
document.getElementById('test').style.visibility = 'hidden';
}
}

function colorToggle()
{
let c = document.getElementById('test').style.color;

if(c=='red')
{
document.getElementById('test').style.color = 'blue';
}
else
{
document.getElementById('test').style.color='red';
}
}

function incFont()
{
document.getElementById('test').style.fontSize='xx-large';
}

function decFont()
{
document.getElementById('test').style.fontSize='medium';
}

function fill()
{
document.getElementById('fill').innerHTML+='Filled<br>';
}
</script>
</head>
<body>

<h1>Trying Features</h1>


<p id="test">HELLO WORLD</p>
<p id='fill'></p>
<button onclick="toggleMe()">Toggle Me</button>
<button onclick="colorToggle()">Color</button>

<button onclick="incFont()">Increase Font</button>
<button onclick="decFont()">Decrease Font</button>

<button onclick="fill()">Fill</button>

</body>
</html>