I'm trying to make a script that when you input text and it has ^1 or ^4 in front of a word then it assigns anything after that until it sees the next ^3 to the proper innerHTML field..
Would I use splits or what?
Really confused atm. My javascript understandings are basic.
I'm trying to make a script that when you input text and it has ^1 or ^4 in front of a word then it assigns anything after that until it sees the next ^3 to the proper innerHTML field..
Would I use splits or what?
Really confused atm. My javascript understandings are basic.
Can you give an example or two of what you expect to input and what you expect as output?
Can you give an example or two of what you expect to input and what you expect as output?
Input: ^1 Hello ^5 My ^2 Name ^6 is Vibos.
0-9 are colors
0 - Black
1 - Red
2 - Green
3 - Yellow
4 - Blue
5 - Cyan
6 - Pink
7 - White
8 - Grey
9 - Light Grey
Output
Hello My Name is Vibos.
I don't need the code, just give me the logic on what I need to use to do this.
What does the ^3 have to do with this and your original request?
My logic would be to split on the ^ characters
And get the first char of each element to determine the color scheme
Then add an appropriate style tag to specify the color chosen.
What does the ^3 have to do with this and your original request?
My logic would be to split on the ^ characters
And get the first char of each element to determine the color scheme
Then add an appropriate style tag to specify the color chosen.
Bookmarks