In my previous article I explained how to read from a SharePoint list available inside a SharePoint App site. In this article my focus would be on how to create a list inside the app and how to add list items to it. The same app I used in the previous example will be used here. Here is the code available in my Default.aspx file. It is simple just a textbox and a lable inside a HTM table and a div which includes an unordered list.
I will start having the same set of definitions in the top.
var context = SP.ClientContext.get_current();
var web = context.get_web();
var user = context.get_web().get_currentUser();
var lists = web.get_lists();