Coding Wala
58 subscribers
6 photos
1 file
11 links
Get Webdevelopment Related Help
and Amazing Videos with Cool Projects
in Html Css Js | ReactJs | NodeJs etc
Also Dont Forget To Subsctibe To Youtube Channel
https://www.youtube.com/channel/UC690azwC4J2tl0Hojk02HsA
Download Telegram
Checkout First Video :-
https://youtu.be/knDzQXBumeA

Source Code For This Videos :-

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Javascript - Adding Score on Button Click</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
section {
height: 100vh;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
background: #000022;
}
.container {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
#button {
background: none;
border: none;
outline: none;
height: 80px;
width: 80px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.623);
cursor: pointer;
}
#button:active {
background: white;
box-shadow: 0 0 15px 0px white;
}
#demoScore {
font-size: 2em;
color: white;
margin-top: 10px;
font-family: "consolas";
}
</style>
</head>
<body>
<section>
<div class="container">
<button id="button">Click</button>
<p id="demoScore">Score : 0s</p>
</div>
</section>
<script type="text/javascript">
const button = document.getElementById("button");
const demoScore = document.getElementById("demoScore");
let score = 0;
button.addEventListener("click", () => {
score++;
demoScore.innerHTML = "Score : " + score + "s";
});
</script>
</body>
</html>