Q:

remove Attribute "contenteditable" from entire document

I have the problem that some <span> elements have the Attribute "contenteditable=true".
That is a problem it should be false.
I am using this as temporary fix
for (i = 0; i < document.getElementsByTagName("span").length; i++) {
    document.getElementsByTagName("span")[i].removeAttribute("contenteditable");
}

But this is not that fast. Is there a better way to remove all "contenteditable" Attributes from the html?

A:

You can use document.querySelectorAll() to refer span which have contenteditable attribute.
document.querySelectorAll("span[contenteditable]").forEach(function(el){
  el.removeAttribute("contenteditable");
})

