title: DOM XSS issue with ajax return value in jquery
body: <p>I am facing DOM XSS issue with below code where on ajax success I am getting data as a return value which I am passing to one of my div and this code is creating DOM XSS.</p>
  
  <p>Can anyone please help me to resolve this issue.
  Return values is coming as HTML data and which I need to assign to DIV.</p>
  
  <pre><code>$.ajax({
      url: 'API/MyDemoURL',
      type: 'POST',
      data: { id: 1},
      cache: false,
      success: function (data) {
          $("#div1").html(data);
      }
  });
  </code></pre>
  
  <p>I was trying with Escape HTML or encode HTML but it replace tags with code and which assign it to div and it print this as string.</p>
  
  <p>Data Coming from server side:-</p>
  
  <pre><code>"&lt;table&gt;&lt;tr&gt;&lt;td&gt;hello World!!&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;"
  </code></pre>