Create JS handler for chapter content saving