In Javascript with editor.selection.getContent()
function i get the image selected in the wp editor:
<img class="alignnone wp-image-xxx size-large" src="http://....." alt="" />
i need to select the class wp-image-xxx
and replace it with a class that include a new id (xxx).
With classList i can get all classes:
var imgselected = editor.selection.getNode();
var classes = imgselected.classList;
But how can i select in javascript the class wp-image-xxx
without knowing the xxx
value so to be able after to replace it?