0

hi there i wanted to put this:

document.write("y = " + i);

inside another variable, like this:

s=s+"\"y = \" \+ i";

but now, i variable is not variable, just a plain text.

how can i fix this? output would be

document.getElementById("output").innerHTML=s;

thank you

1 Answer 1

1

You do not pass to s string a variable - just text i. Try with:

s=s+"y = " + i;

You can also convert it to:

s += "y = " + i;
Sign up to request clarification or add additional context in comments.

1 Comment

omg, i can't believe it. I am stuck with this for more than hour and i would never try this one. thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.