Ein regulärer Ausdruck zum Entfernen von ID-, Stil- und Klassenattributen aus HTML-Tags in JS

Ich habe einen HTML-String in Javascript und möchte mithilfe von Regex ID-, Stil- und Klassenattribute in HTML-Tags entfernen. Ich habe zum Beispiel:

New York City.<div style="padding:20px" id="upp" class="upper"><div style="background:#F2F2F2; color:black; font-size:90%; padding:10px 10px; width:500px;">This message is.</div></div>

Ich möchte, dass dieser String wird:

New York City.<div><div>This message is.</div></div>

Antworten auf die Frage(8)

Ihre Antwort auf die Frage