0

hi i would like to change just part of my code to change the color of my answer to my maths game see the code

document.write("<br>3+2 = " + answer1 + " is incorrect - the correct answer is 5");

see where it says the answer is 5 i would like to change it to red but cant find how to do it

thanks

3
Contributors
13
Replies
14
Views
5 Years
Discussion Span
Last Post by thepanther
0

hi i would like to change just part of my code to change the color of my answer to my maths game see the code

document.write("<br>3+2 = " + answer1 + " is incorrect - the correct answer is 5");

see where it says the answer is 5 i would like to change it to red but cant find how to do it

thanks

document.write(
      "<br>3+2 = "+answer1+" is incorrect! - "+("The correct answer is 5.").fontcolor('red'));
0

excellent thanks also is it the same for this one??

document.write("<br>25-15 = " + answer10 + " The answer is correct ");
0

ekkkkk that dont work lol

document.write("<br>3+2 = " + answer1 + "+("The answer is correct").fontcolor('red'));
0

so what?
I never gave you the green code version for you to go "ekkkkk"
-how hard can it be to simply replace content from this:

document.write("<br>3+2 = "+answer1+" is incorrect! - "+("The correct answer is 5.").fontcolor('red'));

to this:

document.write("<br>3+2 = "+answer10+(" The answer is correct ").fontcolor('red'));

or removing the parens altogether since they may be confusing instead of helping

document.write("<br>3+2 = "+answer1+" is incorrect! - "+"The correct answer is 5.".fontcolor('red'));
document.write("<br>3+2 = "+answer10+" The answer is correct ".fontcolor('red'));
0

thanks very much i think it was confusing matters with the parens, didnt no whether to put it before or after them...thanks

0

now you see how easy it was, you should be more patient when asking people for help giving nothing in return, so even if their given code may prove to be wrong - never go "eeekkk" on them because even then, they've done it with their best intentions and were only trying to help by offering the best they've got.
'Cause you see, you didn't even bother to mark the tread as solved, even though there is no other method for changing the color of the string in place and on the fly, so that others may benefit too.

stay cool.

0

thanks for all your advise how do i make it as solved??

Edited by thepanther: solved

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.