I have an array similar to this:
list = {
cat: "dog",
rain: "sun",
baby: "adult"
};
I have 2 textboxes.
If I type a list separated by comma into one textbox like this:
cat, rain, baby
and press a button, how can I get the paired values in the same comma separated list in another textbox like this?:
dog, sun, adult
Edit: Additional optional question – is it also possible to include other text not in the array but still parse for the ones in the array? For example, if I type “hug my cute cat”, it outputs “hug my cute dog”, etc.
Any clue/direction would be much appreciated! Thank you!
demo: http://jsfiddle.net/6Mn5V/1/