Assignment No.6: Govt .Post Graduate College Jhang
Assignment No.6: Govt .Post Graduate College Jhang
Roll No : 864(110272)
<!DOCTYPE html>
<html>
<head>
<title>media</title>
<style type="text/css">
body {
input[type="number"] {
width: 200px;
height: 30px;
font-size: 18px;
padding: 10px;
button {
width: 100px;
height: 40px;
font-size: 18px;
background-color: #4CAF50;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
button:hover {
background-color: #3e8e41;
#result {
font-size: 24px;
font-weight: bold;
margin-top: 20px;
</style>
</head>
<body>
<p id="result"></p>
<script src="script.js">
document.getElementById('checkButton').addEventListener('click',
function() {
if (num % 2 === 0) {
} else {
</script>
</body>
</html>
.Out Put Of Coding :
.Coding Of Navbar:
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>nav bar</title>
<style type="text/css">
nav{width: 100%;height:80px;background:linear-gradient(red,white);}
div{text-align: center;}
@media(min-width:1024px){
body{width:80%;margin:0 auto;}
@media(max-width:767px){
body{width: 100%;}
</style>
</head>
<body>
<nav>
<ul>
</ul>
</nav>
<br><br>
<form>
<h1>Login</h1>
<br>
<div>
</div>
<br>
<div>
</div>
<br>
<h3>Forgotten Password</h3>
<div>
<button>Login</button>
</div>
<h2>Go to website......</h2>
</form>
</body>
</html>
.Output of Coding :
<html>
<head>
<style type="text/css">```
body {
#yearInput {
width: 200px;
height: 30px;
font-size: 18px;
padding: 10px;
#checkButton {
width: 100px;
height: 40px;
font-size: 18px;
background-color: #4CAF50;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
#checkButton:hover {
background-color: #3e8e41;
#result {
font-size: 24px;
font-weight: bold;
margin-top: 20px;
}
</style>
</head>
<body>
<button id="checkButton">Check</button>
<p id="result"></p>
<script src="script.js">
document.getElementById('checkButton').addEventListener('click', function() {
else if
});
</script>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>TO do list</title>
<style type="text/css">
*{
box-sizing: border-box;
ul {
margin: 0;
padding: 0;
ul li {
cursor: pointer;
position: relative;
background: #eee;
font-size: 18px;
transition: 0.2s;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
ul li:nth-child(odd) {
background: #f9f9f9;
ul li:hover {
background: #ddd;
/* When clicked on, add a background color and strike out text */
ul li.checked {
background: #888;
color: #fff;
text-decoration: line-through;
}
/* Add a "checked" mark when clicked on */
ul li.checked::before {
content: '';
position: absolute;
border-color: #fff;
border-style: solid;
top: 10px;
left: 16px;
transform: rotate(45deg);
height: 15px;
width: 7px;
.close {
position: absolute;
right: 0;
top: 0;
.close:hover {
background-color: #f44336;
color: white;
.header {
background-color: #f44336;
color: white;
text-align: center;
.header:after {
content: "";
display: table;
clear: both;
input {
margin: 0;
border: none;
border-radius: 0;
width: 75%;
padding: 10px;
float: left;
font-size: 16px;
.addBtn {
padding: 10px;
width: 25%;
background: #d9d9d9;
color: #555;
float: left;
text-align: center;
font-size: 16px;
cursor: pointer;
transition: 0.3s;
border-radius: 0;
.addBtn:hover {
background-color: #bbb;
</style>
</head>
<body>
<div id="myDIV" class="header">
<h2>My To Do List</h2>
</div>
<ul id="myUL">
<li>Morning walk</li>
<li>play Cricket</li>
<li>Buy eggs</li>
<li>Read a book</li>
<li>going to college</li>
</ul>
<script type="text/javascript">
var i;
span.className = "close";
span.appendChild(txt);
myNodelist[i].appendChild(span);
}
// Click on a close button to hide the current list item
var i;
close[i].onclick = function() {
div.style.display = "none";
list.addEventListener('click', function(ev) {
ev.target.classList.toggle('checked');
}, false);
function newElement() {
var li = document.createElement("li");
var t = document.createTextNode(inputValue);
li.appendChild(t);
} else {
document.getElementById("myUL").appendChild(li);
document.getElementById("myInput").value = "";
span.className = "close";
span.appendChild(txt);
li.appendChild(span);
close[i].onclick = function() {
div.style.display = "none";
</script>
</body>
</html>
<html lang="en">
<head>
<style type="text/css">
body{
background-color:#64cdac;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
font-family: sans-serif;
.container{
background-color: #eee9e9;
border-radius: 16px;
padding: 20px;
display: flex;
flex-direction: column;
align-items: center;
.title{
font-size: 30px;
margin-bottom: 1.5rem;
.stopwatch{
display: flex;
flex-direction: column;
align-items: center;
gap: 20px;
.timer{
font-size: 40px;
background-color: #ffffff;
padding: 20px;
border-radius: 8px;
@keyframes pulse {
from{
transform: scale(1);
to{
transform: scale(1.05);
.timer span{
width: 110px;
display: inline-block;
text-align: center;
.contorls{
display: flex;
gap: 1rem;
button{
font-size: 1rem;
background-color: #64cdac;
color: #ffffff;
border: none;
border-radius: 8px;
cursor: pointer;
button:hover{
background-color: #0c4b37;
.lap-title{
font-size: 1.5rem;
}
.laps{
width: 100%;
ul{
list-style-type: none;
padding: 0;
margin: 0;
overflow-y: auto;
max-height: 200px;
background-color: #ffffff;
border-radius: 8px;
li{
padding: 1rem;
li:last-child{
border-bottom: none;
}
li span{
font-weight: 700;
</style>
</head>
<body>
<div class="container">
<div class="stopwatch">
<div class="timer">
<span id="milliseconds">00</span>
</div>
<div class="contorls">
<button id="startBtn">Start</button>
<button id="stopBtn">Stop</button>
<button id="pauseBtn">Pause</button>
<button id="resetBtn">Reset</button>
</div>
<div class="laps">
</div>
</div>
</div>
<script src="stopwatch.js">
let minutes = 0;
let seconds = 0;
let milliseconds = 0;
let interval;
</script>
</body>
</html>
.OutPut of coding :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>darkmood</title>
<style type="text/css">
body {
padding: 25px;
background-color: white;
color: black;
font-size: 25px;
.dark-mode {
background-color: black;
color: white;
</style>
</head>
<body>
<h2>Wellcome to my website</h2>
<script type="text/javascript">
function myFunction() {
element.classList.toggle("dark-mode");
</script>
</body>
</html>
.OutPut of coding :