Question: Session storage and local storage not saving html javascript PROBLEM THE DATA IS COMING UP BLANK IN BOTH THE DEVELOPMENT TOOLS AND I+WHEN WEBPAGE IS
Session storage and local storage not saving html javascript
PROBLEM THE DATA IS COMING UP BLANK IN BOTH THE DEVELOPMENT TOOLS AND I+WHEN WEBPAGE IS REFRESHED THE SESSION DATA IS GONE
Here is the html code:
var HTML = "biology.html";
localStorage.setItem("biology.html", HTML);
Enter Question 1:
Next, add a correct answer and several incorrect answers for your question.
Enter Question 2:
Next, add a correct answer and several incorrect answers for your question.
Enter Question 3:
Next, add a correct answer and several incorrect answers for your question.
Enter Question 4:
Next, add a correct answer and several incorrect answers for your question.
Enter Question 5:
Next, add a correct answer and several incorrect answers for your question.
Enter Question 6:
Next, add a correct answer and several incorrect answers for your question.
Enter Question 7:
Next, add a correct answer and several incorrect answers for your question.
Enter Question 8:
Next, add a correct answer and several incorrect answers for your question.
Enter Question 9:
Next, add a correct answer and several incorrect answers for your question.
Enter Question 10:
Next, add a correct answer and several incorrect answers for your question.
Enter Question 11:
Next, add a correct answer and several incorrect answers for your question.
Enter Question 12:
Next, add a correct answer and several incorrect answers for your question.
Enter Question 13:
Next, add a correct answer and several incorrect answers for your question.
Enter Question 14:
Next, add a correct answer and several incorrect answers for your question.
Enter Question 15:
Next, add a correct answer and several incorrect answers for your question.
Enter Question 16:
Next, add a correct answer and several incorrect answers for your question.
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 20px;
}
#myBtn {
display: none;
position: fixed;
bottom: 20px;
right: 30px;
z-index: 99;
font-size: 18px;
border: none;
outline: none;
background-color: red;
color: white;
cursor: pointer;
padding: 15px;
border-radius: 4px;
}
#myBtn:hover {
background-color: #555;
}
// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
document.getElementById("myBtn").style.display = "block";
} else {
document.getElementById("myBtn").style.display = "none";
}
}
// When the user clicks on the button, scroll to the top of the document
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
