How can you manipulate the data returned by the .ajax method ?

How can you manipulate the data returned by the .ajax method ?

Hello,

I'm currently working on a form where an entire HTML page is returned via the .ajax method.
I would like to display only the content of the div with the id "content" (of the page returned) in the div with the id "result" (in the calling page). Here is my current script :

  1. $(document).ready(function(){
       $("#form").click(function(){
           $.ajax({
       type: "POST",
       url: "enregistrement/",
       data: "mail="+$("#mail").val()+"&numero="+$("#numero").val(),
       success: function(msg){
         var res = $(msg).find("#content");







         $("#result").html(res);
       }
     });
           return false;
       })
    });








Any ideas on the mistakes in my code ? I'm not sure that I'm using the selectors properly...
Thanks for your help !

Arnaud.