title: How to store div content to DB with Ajax
body: <p>In my project, I want to store div content to DB. The content is like:</p>
  
  <pre><code>&lt;span&gt;name:&lt;/span&gt;&lt;input type="text" id="inputid" value="John"&gt;&lt;br /&gt;
  </code></pre>
  
  <p>So I chose innerHTML to fetch them successfully. And with Ajax, the content would be stored to DB.</p>
  
  <p>Yesterday, I found that stripslashes() should be called to format the content, and it could be updated successfully.</p>
  
  <p>But today  stripslashes() made nothing done. Here is my js code:</p>
  
  <pre><code>var slcId = $('#slcStNum').val();
  var tmTgDvHtml=document.getElementById("timeTagDiv").innerHTML;
  $.ajax({
      dataType:'html',
      type:"POST",
      url:"get_ajax_csc_div.php",
      data:{htmlCnt:tmTgDvHtml,slcId:slcId},
      success:function (data) 
      {
          alert("test");
      }
   });
  </code></pre>
  
  <p>Here is html code:</p>
  
  <pre><code>&lt;div id="timeTagDiv"&gt;&lt;span&gt;name:&lt;/span&gt;&lt;input type="text" id="inputid" value="John"&gt;&lt;br /&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Here is get_ajax_csc_div.php code</p>
  
  <pre><code>&lt;?php
  if(isset($_POST['htmlCnt']))
  {   
   include("DB.php");
   $htcnt=stripslashes(".$_POST['htmlCnt'].");
   $sql="update IDC SET stprocess='$htcnt' where id='".$_POST['slcId']."';";
   $sel = $conn-&gt;exec($sql);  
   }
   ?&gt;
  </code></pre>
  
  <p>I changed dataType:'html' to dataType:'json', but it failed again. Who can help me?</p>