title: XSS - How to remove broken HTMLs from user(<intput type="text" onclick="alert('12')") from user input
body: <p>Currently I'm using Jsoup for cleaning the user input. But using this I cannot remove the broken HTMLs tags like the one below</p>
  
  <pre><code>&lt;intput type="text" onclick="alert('12')"
  </code></pre>
  
  <p>So when this value is rendered in the browser JS is getting executed.</p>
  
  <p>HTML Doctype used: </p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; 
  </code></pre>
  
  <p>Is there a way to prevent this?</p>