title: Anybody know a solid library/function in Javascript to clean user input
body: <p>Do you guys know of a solid library/function in Javascript to clean user input.</p>
  
  <p>Mainly for preventing XSS attacks and the sort. </p>
  
  <p>It would be a plus if the said library had the option of allowing certain tags etc.</p>
  
  <p><strong>EDIT:</strong> I'm using node.js on the backend. That's why I need a javascript library for that sort of thing.</p>
  
  <p>People are recommending a part of Google Caja here:
  <a href="https://stackoverflow.com/questions/3705356/preventing-xss-in-node-js-server-side-javascript">Preventing XSS in Node.js / server side javascript</a></p>
  
  <p>But I was just hoping to get more options.</p>