1//first install package: npm install sanitize-html --save
2var sanitizeHtml = require('sanitize-html');
3
4var dirty = 'This is test <a style="opacity: 0.1" href="javascript:void(0)">Link</a>';
5var clean = sanitizeHtml(dirty);
6console.log(clean);
7//result: This is test <a>Link</a>
8