0
Not working this code.
13 odpowiedzi
+ 2
Ok thanks
0
Line 7 Javascript is Something wrong i try to find it
0
Ok
0
<!DOCTYPE html>
<html>
<head>
<title>Count Example</title>
</head>
<body>
<button id="decreaseBtn">Decrease</button>
<button id="restBtn">Reset</button>
<button id="increaseBtn">Increase</button>
<p>Count: <span id="countLabel">0</span></p>
<script>
let count = 0;
document.getElementById("restBtn").onclick = function () {
count = 0;
document.getElementById("countLabel").innerHTML = count;
}
document.getElementById("increaseBtn").onclick = function () {
count += 1;
document.getElementById("countLabel").innerHTML = count;
}
// You can add functionality for the "decreaseBtn" button if needed.
</script>
</body>
</html>
0
What changes you do
0
I made several changes to your code to make it functional:
I added HTML elements for the buttons and the count label with the appropriate IDs: "decreaseBtn," "restBtn," "increaseBtn," and "countLabel."
I removed the commented-out lines that were causing syntax errors.
I fixed a typo in the document.getElementById("countLable") line, changing it to document.getElementById("countLabel") to match the correct ID.
I wrapped your JavaScript code inside <script> tags and placed it at the end of the HTML body to ensure that it runs after the HTML elements are loaded.
0
I done HTML and css
0
Same
0
But error coming
0
You Wright "countLabel" wrong
0
Your sended code working or not
0
Works fine
0
Np