The third button is supposed to Bring up a prompt in which you can type in a number from 1-3 and if you type something else it should say that what you typed in is not a number between 1 and 3, but if you type 1/2/3 it should bring up a prompt in which you can type your text, and the text that is under 1/2/3 should change into what you typed. Instead, when you type in something not from 1 to 3 in the first prompt it still brings up the second one(which it should not), and no matter what you type in the first prompt it will only change the first text. Sorry if it's just a dumb mistake, i spent hours trying to figure it out.
function HI()
{
var A = prompt("Choose Text(1-3)")
if(A = 1)
{
A=document.getElementById("1");
var B = prompt("Type Your Text")
A.innerHTML=B;
}
else if(A = 2)
{
A=document.getElementById("2");
var B = prompt("Type Your Text")
A.innerHTML=B;
}
else if(A = 3)
{
A=document.getElementById("3");
var B = prompt("Type Your Text")
A.innerHTML=B;
}
else
{
alert("What you typed is not a between 1 and 3")
}
}
=is assignment,==and===are comparison