Ask coding questions

← Back to all posts
help with java
KillerCl0wn

I'm trying to make the alert text the color you say is your favorite color. how would I do that?

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
KillerCl0wn
Comments
hotnewtop
Coder100

you meant javascript

here's how: prompt("what is your favorite color?")

the prompt instead of alert prompts you.

you can then set it as a variable:

KillerCl0wn

@Coder100 will that make the code that color to

Coder100
KillerCl0wn

@Coder100 k I made it do something else so I got it.

Coder100
KillerCl0wn

@Coder100 thanks

Coder100
KillerCl0wn

@Coder100 hey do you think you could help me with making a portfolio.