title: Populating HTML div using PageMethods/AJAX
body: <p>My problem is little strange. Of course I checked many examples before I write here. </p>
  
  <p>I have a div element at aspx i am sending Post with AJAX to populate it</p>
  
  <pre><code>&lt;script&gt;
       function send(inputa, inputb) {
  
           var dataString = JSON.stringify({
               Id: inputa,
               Opt: inputb                 
           });
  
           $.ajax({
               type: "POST",
               url: "my.aspx/Myfunction",
               data: dataString,
               contentType: "application/json; charset=utf-8",
               dataType: "json",
               success: function (result) {
                   alert(result.d);
                   $("divtable").val(result.d);
               },
               error: function () {
                   alert("Problem Occured");
               }
           });
       }
  &lt;/script&gt;
  </code></pre>
  
  <p>At alert I can see my response is good with no problem, but I could not send it to my div element. I tried many scripts</p>
  
  <pre><code> $("divtable").val(result.d);    
   $("#divtable").val(result.d);    
   $("divtable").html(result.d);    
   $(.divtable).val(result.d);
  </code></pre>
  
  <p>and I could not success. Every searh I made I found different answers.
  Can someone good at this give us the correct answer please.</p>