Question: Html javascript I'm trying to do a session storage function and a disply function, but i cat get both functions to work at the same

Html javascript

I'm trying to do a session storage function and a disply function, but i cat get both functions to work at the same time

Code:

Enter Question 16:

Next, add a correct answer and several incorrect answers for your question.

function postQuestion() {

var obj = {

question: document.getElementById("question16").value,

choice62: document.getElementById("choice62").value,

choice63: document.getElementById("choice63").value,

choice64: document.getElementById("choice64").value,

choice65: document.getElementById("choice65").value

}

try {

sessionStorage.setItem("data", JSON.stringify(obj));

} catch (error) {

alert("Enable Session storage");

}

return false;

}

function PreviewImage16() {

var oFReader = new FileReader();

oFReader.readAsDataURL(document.getElementById("uploadImage16").files[0]);

oFReader.onload = function (oFREvent) {

document.getElementById("uploadPreview16").src = oFREvent.target.result;

sessionStorage.setItem("image", oFREvent.target.result);

};

};

function displayQuestion() {

var question = document.getElementById("question16").value;

var choice62 = document.getElementById("choice62").value;

var choice63 = document.getElementById("choice63").value;

var choice64 = document.getElementById("choice64").value;

var choice65 = document.getElementById("choice65").value;

document.getElementById("spnQuestion").textContent = question;

document.getElementById("spnChoice1").textContent = choice62;

document.getElementById("spnChoice2").textContent = choice63;

document.getElementById("spnChoice3").textContent = choice64;

document.getElementById("spnChoice4").textContent = choice65;

return false;

}

function PreviewImage16() {

var oFReader = new FileReader();

oFReader.readAsDataURL(document.getElementById("uploadImage16").files[0]);

oFReader.onload = function (oFREvent) {

document.getElementById("uploadPreview16").src = oFREvent.target.result;

};

};

function displayQuestion() {

var question = document.getElementById("question16").value;

var choice62 = document.getElementById("choice62").value;

var choice63 = document.getElementById("choice63").value;

var choice64 = document.getElementById("choice64").value;

var choice65 = document.getElementById("choice65").value;

document.getElementById("spnQuestion").textContent = question;

document.getElementById("spnChoice1").textContent = choice62;

document.getElementById("spnChoice2").textContent = choice63;

document.getElementById("spnChoice3").textContent = choice64;

document.getElementById("spnChoice4").textContent = choice65;

return false;

}

function PreviewImage16() {

var oFReader = new FileReader();

oFReader.readAsDataURL(document.getElementById("uploadImage16").files[0]);

oFReader.onload = function (oFREvent) {

document.getElementById("uploadPreview16").src = oFREvent.target.result;

};

};

Question :

Choice 1:

Choice 2:

Choice 3:

Choice 4:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!