Javascript variable color | SoloLearn: Learn to code for FREE!


Javascript variable color

I was wondering if I could somehow make a paragraph out of a few variables from the Javascript part so each variable has its own color... Or just one variable has a different color. I combined them with concat() and used toString() for numbers, arrays and similar. I have found fontColor() method, but it doesn’t work... Here’s an example (I’d like to color the number):

7/31/2018 10:30:10 AM


4 Answers

New Answer


Your on submit function needs event.preventDefault() to disable form submission to external by default.


There are several errors in your code, but to answer the question you can use .style.color or just CSS to assign the text colour in an element and <span> elements to distinguish between the text.


An example was added


You need* to install Juggling-db Master github ¬¬¬¬to be continued