this is my code

confirm("In this game you will follow the directions in the text box shown")
prompt("To start the game type continue the click ok")
prompt("An arrow is flying out of the sky at you. What will you do. Type the number of the move you want to do then press ok. --------------------------------------------------------------I: Use shield II:Try to hit with sword III:Try to run")
if("I.length = 1")
confirm("the arrow hit you in that back")

if("II.length > 1")
confirm("your sword slipped and the arrow hit you")

if("III.lenght > 2")
prompt("the arrow hit your shield and you survived. type and click ok")

When the text boxes come up and i type in III the answer for the first option will come up


"I.length = 1" is a string

strings are evaluated to true, your condition is never evaluated

also, a single equal sign means assign in JS


i also did if("1") and it didn't work


You need to check if the length of I is equal to 1. Doing if("1") does not return a boolean other than true.


so do you know any things i could do to have options like this


if you want to do a comparison, don't put quotation marks around it, this will simply make it a string