I am creating an input field which updates a div on keypressdown. So, if the user types 'test' into the input field, the div is populated with the text 'test'.
This is pretty simple and working fine. However, I need it to create multiple divs for multiple words. So, if the user types 'hello world' there will be two divs created - one for 'hello' and one for 'world'.
How do I go about this?
I've set up a JS Fiddle if that helps:
This is my JS:
var viewModel = {
styleChoices: ["yellow", "red", "black", "big"],
style: ko.observable("yellow"),
text: ko.observable("text"),
};
ko.applyBindings(viewModel);
All help appreciated.
Thanks in advance.