I am looking for dynamic function which can remove something like "style" attribute to multiples different elements at a time which are not child elements. Like below I have script for adding multiple attributes to element. Same way removing attribute to multiple different elements like removeAttributes(el1, el2, el3, { "style" }); or you can write any script which is right way to do.
<script>
function setAttributes(el, options) {
Object.keys(options).forEach(function(attr) {
el.setAttribute(attr, options[attr]);
})
}
setAttributes(img, {
"src": "../images/...",
"title": "image title",
"alt": "text"
});
<script>