Title: Jean Valjean
Content:  a sailor who had gotten stuck in a dangerous situation up in the ship's rigging. Thereafter he is officially presumed dead. Valjean goes to Montfermeil, where he meets Cosette alone in the forest on Christmas Eve, 1823. He accompanies her back to the inn; and watches that evening as the Thénardiers mistreat her very badly. He sees the Thénardiers' daughters Éponine and Azelma acting unkindly to her as well, tattling on her to their mother when she tries to play with their temporarily abandoned doll. After seeing this, Valjean briefly leaves the inn and returns with a beautiful new doll to give to Cosette, which 
Title: Cosette
Content:  that "fear was spread all over her". While Fantine is in the hospital, the mayor of Montreuil-sur-Mer—Jean Valjean masquerading as "Madeleine" to avoid revealing that he is a paroled convict—vows to retrieve Cosette for her. Although Fantine dies before seeing her daughter, Valjean becomes determined to look after the young girl. When he arrives in Montfermeil on Christmas Eve, Valjean finds Cosette fetching a pail of water and accompanies her back to the inn, where he witnesses her mistreatment by the Thénardiers as well as the unkindnesses of their daughters Éponine and Azelma. Valjean leaves the inn and returns with an expensive new doll which he offers to Cosette. At first reluctant, Cosette joyfully accepts it, which infuriates Thénardier; Éponine and Azelma 
Title: Jean Valjean
Content:  actually Jean Valjean. M. Thénardier is soon overcome with grief at having sold Cosette too cheaply and runs after them. When M. Thénardier demands more money, Valjean gives him the note Fantine signed before she died, saying that the bearer of the note was authorized to take Cosette. M. Thénardier tries to continue following Valjean, but is soon frightened back to the inn. Valjean takes Cosette to Paris, where they live in No. 50-52 Boulevard de l'Hôpital, in the so-called "Gorbeau House." They cannot live calmly for long—in Spring 1824, Javert, who has been promoted to the police in Paris, finds the house. He has 
Title: Jean Valjean
Content:  has been a man hiding in his garden, decides to move to England. He takes Cosette to the house in the Rue de l'Homme-Armé. This takes places during the first days of June 1832. It is only there that he learns of Cosette's love for Marius when a young boy (Gavroche) delivers a letter from Marius to Cosette, which mentions that Marius is at the barricade and will die as he promised her, since she left without a forwarding address. Valjean has another long inward struggle, at first feeling relief about Marius' certain death, then guilt about his former feeling. He joins the rebellion without an actual decision about his following actions.
Title: Thénardiers
Content:  After Fantine's death, Jean Valjean arrives in Montfermeil on Christmas Eve. He finds Cosette all alone fetching a pail of water for the Thénardiers in a dark forest and accompanies her back to the inn. After arranging lodgings at the inn for the night, he observes how the Thénardiers abuse her and how Éponine and Azelma mimic their parents' behavior and complain when Cosette plays with their doll. Valjean leaves the inn and returns a moment later with a beautiful new doll, which he offers to Cosette. At first Cosette is unsure if the doll really is for her and is reluctant to take it, but then joyfully accepts it. Mme. Thénardier is furious but M. Thénardier tells her that Valjean can do as he wishes as long as he pays them. On Christmas Day, Valjean informs the Thénardiers that he wants 
Title: Jean Valjean
Content:  happily accepts. This makes Mme. Thénardier furious with Valjean, affronted that he would do such a thing for Cosette instead of her own daughters. M. Thénardier tells her that Valjean can do as he wishes as long as he pays them. That evening, Mme. Thénardier insists that Cosette will be turned out onto the street the next day. The next morning, Christmas Day, Valjean offers to take Cosette with him. Mme. Thénardier immediately accepts, but M. Thénardier haggles for a compensation and gets 1500 francs in the end. Valjean takes Cosette with him. Only now does the book confirm that the mysterious man Cosette met 
Title: Cosette
Content:  Valjean takes Cosette to Paris, where they lodge at Gorbeau House; Valjean begins her education. When Inspector Javert discovers Valjean's whereabouts, he and Cosette must flee. Valjean climbs over a wall and they find themselves in a garden attached to a convent. The gardener Fauchelevent recognizes Valjean as the man who rescued him years earlier and agrees to shelter them. Valjean poses as Fauchelevent's brother and says he is Cosette's grandfather. They live peacefully in the convent for many years as Valjean works with Fauchelevent and Cosette attends the convent school. Over time, she appears to have no recollection of her childhood before arriving at the convent. As Cosette matures, 
Title: Cosette
Content:  jealous. The next morning, Christmas Day, Valjean informs the Thénardiers that he has come to take Cosette with him. Madame Thénardier immediately agrees but Thénardier pretends affection for Cosette and acts reluctant. Valjean pays 1500 francs to settle Fantine's debts and leaves with Cosette. Thénardier tries to swindle more money out of Valjean by saying that he has changed his mind and wants Cosette back, informing Valjean that Cosette's mother had entrusted her to his care and he cannot release her without a note from her mother. Valjean, agreeing with him, hands him a letter signed by Fantine. Thénardier then attempts to order Valjean to return Cosette or to pay a thousand crowns, but Valjean ignores him and leaves with Cosette.
Title: Jean Valjean
Content:  the next day while Valjean is in Fantine's room. Valjean asks for three days to get Cosette from Montfermeil and give her to Fantine before he is arrested and Javert refuses, saying that it would be too easy for Valjean to escape. Fantine (who'd been told by the doctors that Valjean, who'd been at the trial, had been getting her daughter) was shocked to find that her daughter was not there already and that her savior was being arrested, and died of shock (her body had been greatly weakened by her poor living conditions and long illness, probably tuberculosis). 
Title: Jean Valjean
Content:  Only now is when Valjean's and Cosette's life during the last years revealed: They lived in the convent until Fauchelevent's death, and left in 1829; Cosette is fourteen years old. Valjean buys three houses (so that he will always have somewhere to flee to) in Rue de l'Ouest (today Rue D'Assas), Rue Plumet (today Rue Oudinot) and No. 7 Rue de l'Homme-Armé (today 40, rue des Archives), mostly living in Rue Plumet. Valjean does not know that Cosette returns Marius' love and does not understand why Cosette seems less attached to "her grandfather" than before. He is happy to see that the brand wound he got during the attack makes her worry and 

Question: why did jean valjean take care of cosette?
Answer: he had promised.