Allow specific attrs in element by javascript
===

i got a string, for example: `<div style='text-align:center;' otherattr="script">`

And i want to allow specific attrs, for example allow only the style attr,

so it should return me: `<div style='text-align:center;'>`

i want to allow those attrs: style, href, src, align

Thanks allot..