On the page, we have the following components: a list named platformsList, a text input named newPlatformField, and a button.
Paste in the following code:
var list = Appery("platformsList");
var newPlatform = Appery("newPlatformField").val();
list.append("<li><a>" + newPlatform + "</a></li>").listview("refresh");
In the code above, we put a reference for a list component into a list variable and put the value of the text input into a newPlatform variable using the jQuery val function. Then, we use the append method to add a new item with the text we’ve entered in the field and refresh the view using the listview method. Finally, we clear the value of the input field.
Let’s test the project in the browser. As you might already know, we are working on Blackberry and Windows Phone support for Appery.io, so let’s add them into our list.